summaryrefslogtreecommitdiff
path: root/modules/hosts/sol
diff options
context:
space:
mode:
Diffstat (limited to 'modules/hosts/sol')
-rw-r--r--modules/hosts/sol/configuration.nix61
-rw-r--r--modules/hosts/sol/default.nix25
-rw-r--r--modules/hosts/sol/disko.nix88
-rw-r--r--modules/hosts/sol/hardware.nix20
-rw-r--r--modules/hosts/sol/home.nix14
-rw-r--r--modules/hosts/sol/preservation.nix54
6 files changed, 262 insertions, 0 deletions
diff --git a/modules/hosts/sol/configuration.nix b/modules/hosts/sol/configuration.nix
new file mode 100644
index 0000000..242257e
--- /dev/null
+++ b/modules/hosts/sol/configuration.nix
@@ -0,0 +1,61 @@
+{ self, inputs, ... }: {
+
+ flake.nixosModules.solConfiguration = { config, lib, pkgs, ... }:
+
+ {
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ nixpkgs.config.allowUnfree = true;
+
+ imports = with self.nixosModules; [
+ solHardware
+ powerManagement
+ niri
+ audio
+ # audioProduction
+ ];
+
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+ boot.kernelPackages = pkgs.linuxPackages_latest;
+
+ networking.hostName = "sol";
+ networking.networkmanager.enable = true;
+
+ time.timeZone = "Europe/Berlin";
+
+ i18n.defaultLocale = "en_IE.UTF-8";
+ console = {
+ font = "Lat2-Terminus16";
+ keyMap = "us";
+ };
+
+ services.displayManager.ly.enable = true;
+ services.emacs.enable = true;
+
+ programs.steam.enable = true;
+
+ programs.direnv.enable = true;
+ programs.direnv.nix-direnv.enable = true;
+
+ services.printing.enable = true;
+
+ # Enable touchpad support (enabled default in most desktopManager).
+ services.libinput.enable = true;
+
+ users.users.dk = {
+ isNormalUser = true;
+ extraGroups = [ "wheel" ];
+ hashedPasswordFile = "/persistent/passwd";
+ };
+ home-manager.users.dk = self.homeModules.solHome;
+
+ environment.systemPackages = [
+ pkgs.devenv
+ pkgs.wget
+ pkgs.git
+ inputs.home-manager.packages.${pkgs.system}.default
+ ];
+
+ system.stateVersion = "26.05";
+ };
+}
diff --git a/modules/hosts/sol/default.nix b/modules/hosts/sol/default.nix
new file mode 100644
index 0000000..33163cc
--- /dev/null
+++ b/modules/hosts/sol/default.nix
@@ -0,0 +1,25 @@
+{ self, inputs, pkgs, ... } : {
+
+ flake.nixosConfigurations.sol = inputs.nixpkgs.lib.nixosSystem {
+ modules = [
+ inputs.disko.nixosModules.disko
+ inputs.preservation.nixosModules.default
+ inputs.musnix.nixosModules.musnix
+ self.nixosModules.solConfiguration
+ self.nixosModules.solPreservation
+ self.nixosModules.solDisko
+ self.nixosModules.myHomeManager
+ ];
+ };
+
+ flake.homeConfigurations.sol = inputs.home-manager.lib.homeManagerConfiguration {
+ pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
+ modules = [
+ self.homeModules.solHome
+ {
+ home.username = "dk";
+ home.homeDirectory = "/home/dk";
+ }
+ ];
+ };
+}
diff --git a/modules/hosts/sol/disko.nix b/modules/hosts/sol/disko.nix
new file mode 100644
index 0000000..e110cdd
--- /dev/null
+++ b/modules/hosts/sol/disko.nix
@@ -0,0 +1,88 @@
+{ self, inputs, ...}: {
+
+flake.nixosModules.solDisko = { pkgs, lib, ... }: {
+ fileSystems."/nix".neededForBoot = true;
+ fileSystems."/persistent".neededForBoot = true;
+ disko.devices.nodev = {
+ "/" = {
+ fsType = "tmpfs";
+ mountOptions = [
+ "size=50%"
+ "mode=755"
+ ];
+ };
+ };
+
+ disko.devices.disk.hdd = {
+ device = "";
+ type = "disk";
+
+ content.type = "gpt";
+ content.partitions.data = {
+ size = "100%";
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/hdd";
+ };
+ };
+ };
+
+ disko.devices.disk.main = {
+ device = "/dev/nvme0n1";
+ type = "disk";
+
+ content.type = "gpt";
+
+ content.partitions.boot = {
+ name = "boot";
+ size = "1M";
+ type = "EF02";
+ };
+
+ content.partitions.esp = {
+ name = "ESP";
+ size = "1G";
+ type = "EF00";
+
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ };
+
+ content.partitions.swap = {
+ size = "8G";
+
+ content = {
+ type = "swap";
+ resumeDevice = true;
+ };
+ };
+
+ content.partitions.root = {
+ name = "root";
+ size = "100%";
+
+ content = {
+ type = "btrfs";
+ extraArgs = ["-f"];
+
+ subvolumes = {
+ "/persistent" = {
+ mountOptions = ["subvol=persistent" "noatime"];
+ mountpoint = "/persistent";
+ };
+
+ "/nix" = {
+ mountOptions = ["subvol=nix" "noatime"];
+ mountpoint = "/nix";
+ };
+ };
+ };
+ };
+ };
+};
+
+}
diff --git a/modules/hosts/sol/hardware.nix b/modules/hosts/sol/hardware.nix
new file mode 100644
index 0000000..8c00011
--- /dev/null
+++ b/modules/hosts/sol/hardware.nix
@@ -0,0 +1,20 @@
+{ self, inputs, ... }: {
+
+ flake.nixosModules.lunaHardware = { config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
+;
+
+}
diff --git a/modules/hosts/sol/home.nix b/modules/hosts/sol/home.nix
new file mode 100644
index 0000000..f8de83a
--- /dev/null
+++ b/modules/hosts/sol/home.nix
@@ -0,0 +1,14 @@
+{ self, inputs, ... }: {
+
+ flake.homeModules.solHome = { pkgs, ... }: {
+ imports = [
+ self.homeModules.zen-browser
+ self.homeModules.vesktop
+ ];
+
+ programs.bash.enable = true;
+
+ home.stateVersion = "26.05";
+ };
+
+}
diff --git a/modules/hosts/sol/preservation.nix b/modules/hosts/sol/preservation.nix
new file mode 100644
index 0000000..a42c890
--- /dev/null
+++ b/modules/hosts/sol/preservation.nix
@@ -0,0 +1,54 @@
+{ self, inputs, ... }: {
+
+flake.nixosModules.solPreservation = { pkgs, lib, ... }: {
+ boot.tmp.cleanOnBoot = true;
+
+ preservation = {
+ enable = true;
+
+ preserveAt."/persistent" = {
+ directories = [
+ "/etc/nixos"
+ {
+ directory = "/var/lib/nixos";
+ inInitrd = true;
+ }
+ "/var/lib/systemd/timers"
+ "/var/lib/bluetooth"
+ "/etc/NetworkManager/system-connections"
+ {
+ directory = "/tmp";
+ mode = "1777";
+ }
+ ];
+ files = [
+ {
+ file = "/etc/machine-id";
+ inInitrd = true;
+ }
+ ];
+
+ users.dk = {
+ directories = [
+ "Pictures"
+ "Projects"
+ "Music"
+ ".config/emacs"
+ "org"
+ ".ssh"
+ ".config/zen"
+ ".cache"
+ ".config/nixos"
+ ".steam"
+ ".local/share/Steam"
+ ".config/vesktop"
+ ".config/ardour9"
+ ".config/guitarix"
+ ];
+ files = [];
+ };
+ };
+ };
+};
+
+}