diff --git a/README.md b/README.md index 5e3855e..3e5e1bc 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Thanks for taking a look at my Nix* flake! While this is primarily organized for my own use, you may find each individual service or config useful to read, reference, learn from, and adapt for your own systems. ### Installation -Installing this flake is best done from an existing system. A minimal install is fastest, but is up to you. After installing NixOS, backup your hardware-config.nix file, and adapt it to fit the format of ``/hosts``, adjusting for your specific system. - -An initial install will can be done with ``nixos-rebuild switch --flake /etc/nixos/.#host``, where ``host`` is a hostname defined in this flake. You may also have to enable "experimental" features with a flag, such as nix-command and flakes. - -Home-Manager is handled with the system, but can be used on other systems with Nix without root. A rebuild of a user's home is done with ``home-manager switch --flake /etc/nixos/.#user``, as defined under ``homeConfigurations`` in the flake. +You can install this flake from any system with Nix installed, including any ISO. +An initial install will can be done with ``nixos-rebuild switch --flake /etc/nixos/.#host``, where ``host`` is a hostname defined in this flake. You may also have to enable "experimental" features with a flag, such as nix-command and flakes. +You will want to generate a hardware-config.nix file using ``nixos-generate-config --root ./ --no-filesystems``, and adapt it to fit the format of ``/hosts``, adjusting for your specific system. ### Usage +Home-Manager is handled with the system, but can be used on other systems with Nix without root. A rebuild of a user's home is done with ``home-manager switch --flake /etc/nixos/.#user``, as defined under ``homeConfigurations`` in the flake. + My config uses these tools: ``Sway`` - Window manager / Desktop ``ZSH`` - Primary shell diff --git a/flake.lock b/flake.lock index f9b3de1..380edb4 100644 --- a/flake.lock +++ b/flake.lock @@ -314,11 +314,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1740880473, - "narHash": "sha256-qS5cbZantakWcCjVjWAPilGOaV04ZN8dVXcsbsDhaYc=", + "lastModified": 1741312303, + "narHash": "sha256-IdyQAirUjIcEDcfZbzoVKc983wJxMN4hbTPnjyU1vFY=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "2143797cb223af6441d2085552da930f7430e3d3", + "rev": "e8797eabd0a0835bf6dacd0087c2cbfb0bad8f9d", "type": "github" }, "original": { @@ -406,11 +406,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1740743217, - "narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=", + "lastModified": 1741332913, + "narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c", + "rev": "20755fa05115c84be00b04690630cb38f0a203ad", "type": "github" }, "original": { @@ -421,11 +421,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1740695751, - "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", + "lastModified": 1741246872, + "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", + "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", "type": "github" }, "original": { @@ -442,11 +442,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1740905231, - "narHash": "sha256-L0f/pwKTkXLojuYJKNV3bYBTvZ8leOcKRNpnrD3k9YY=", + "lastModified": 1741383898, + "narHash": "sha256-hIiLfvj0qZjBLhk5eBhIv8SZJ+bI8d06Hxp480mJ1aI=", "owner": "nix-community", "repo": "NUR", - "rev": "e48029b67f41c929589353ee08b84c02906f5756", + "rev": "54352c3c3110f34e71a2ae9a0210aa6955555760", "type": "github" }, "original": { @@ -574,11 +574,11 @@ }, "unstable": { "locked": { - "lastModified": 1740695751, - "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", + "lastModified": 1741246872, + "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", + "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9d2fe3e..470cb4d 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,6 @@ kitty = mkNix [ ./hosts/kitty ]; # Dell Optiplex 7010 midas = mkNix [ ./hosts/midas ]; # Dell Optiplex 5040 prophet = mkNix [ ./hosts/prophet ]; # Oracle Neoverse-N1 - rubble = mkNix [ ./hosts/rubble ]; # ROCKPro64 SBC }; # home-manager switch --flake /etc/nixos#arch diff --git a/hosts/envy/boot/default.nix b/hosts/envy/boot/default.nix new file mode 100644 index 0000000..50d146f --- /dev/null +++ b/hosts/envy/boot/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/envy/default.nix b/hosts/envy/default.nix index 13edf40..8e1ffd4 100644 --- a/hosts/envy/default.nix +++ b/hosts/envy/default.nix @@ -1,6 +1,7 @@ { config, lib, ... }: { imports = [ + ./boot ./disko ./filesystems ./hardware diff --git a/hosts/redmond/boot/default.nix b/hosts/redmond/boot/default.nix index 0fe3db8..b23818a 100644 --- a/hosts/redmond/boot/default.nix +++ b/hosts/redmond/boot/default.nix @@ -1,7 +1,10 @@ { ... }: { - boot.kernelParams = [ - "radeon.cik_support=0" - "amdgpu.cik_support=1" - ]; + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernelParams = [ + "radeon.cik_support=0" + "amdgpu.cik_support=1" + ]; + }; } diff --git a/hosts/redmond/hardware/default.nix b/hosts/redmond/hardware/default.nix index e1f7c30..66dec5d 100644 --- a/hosts/redmond/hardware/default.nix +++ b/hosts/redmond/hardware/default.nix @@ -1,4 +1,3 @@ -# nixos-generate-config --root ./ --no-filesystems { config, lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; diff --git a/hosts/rubble/default.nix b/hosts/rubble/default.nix deleted file mode 100644 index 259b3e5..0000000 --- a/hosts/rubble/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: -{ - imports = [ - ./disko - ./hardware - ./users - ../../modules/system - ]; - - networking = { - hostName = "rubble"; - hostId = "e0b1fcef"; - wg-quick.interfaces.wgc.address = [ "10.100.0.28/24" ]; - }; - - system = { - desktop.enable = true; - extlinux.enable = true; - wireless.enable = true; - wireguard.client.enable = true; - stateVersion = "24.11"; - }; -} diff --git a/hosts/rubble/disko/default.nix b/hosts/rubble/disko/default.nix deleted file mode 100644 index 4022bcc..0000000 --- a/hosts/rubble/disko/default.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ config, disko, ... }: -{ - imports = [ disko.nixosModules.disko ]; - - disko.devices = { - disk = { - "${config.networking.hostName}" = { - type = "disk"; - device = "/dev/mmcblk1"; - content = { - type = "gpt"; - partitions = { - ESP = { - priority = 1; - size = "2G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "${config.networking.hostName}-disk"; - settings.allowDiscards = true; - passwordFile = "/tmp/secret.key"; - content = { - type = "lvm_pv"; - vg = "${config.networking.hostName}"; - }; - }; - }; - }; - }; - }; - }; - - lvm_vg = { - "${config.networking.hostName}" = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/root" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" "ssd" ]; - }; - "/prev" = { - mountpoint = "/prev"; - mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" "ssd" ]; - }; - - # Impermanence - "/persist" = { - mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "noatime" "ssd" ]; - }; - "/persist/.snapshots" = { }; - "/persist/home/${config.sysusers.main}" = { }; - "/persist/home/${config.sysusers.main}/.snapshots" = { }; - }; - }; - }; - swap = { - size = "4G"; - content = { - type = "swap"; - discardPolicy = "both"; - }; - }; - }; - }; - }; - }; - - # Needed for impermanence - fileSystems."/persist".neededForBoot = true; -} diff --git a/hosts/rubble/hardware/default.nix b/hosts/rubble/hardware/default.nix deleted file mode 100644 index baab64a..0000000 --- a/hosts/rubble/hardware/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, lib, modulesPath, ... }: -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.kernelModules = [ "ahci" "dm-snapshot" "mmc_core" "pcie_rockchip_host" "phy_rockchip_pcie" "rockchip_dfi" "rockchip_thermal" "rtc_rk808" "rockchip_saradc" "uas" "fusb302" ]; - - nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; -} diff --git a/hosts/rubble/id_ed25519.pub b/hosts/rubble/id_ed25519.pub deleted file mode 100644 index 075c2ce..0000000 --- a/hosts/rubble/id_ed25519.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF4oyz5yAvmVZDdr3NL2AmlnCA6Z17b2Vj0FXj07DFiv diff --git a/hosts/rubble/users/default.nix b/hosts/rubble/users/default.nix deleted file mode 100644 index 57e7f20..0000000 --- a/hosts/rubble/users/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - imports = [ ./main ]; -} diff --git a/hosts/rubble/users/main/default.nix b/hosts/rubble/users/main/default.nix deleted file mode 100644 index fed1d31..0000000 --- a/hosts/rubble/users/main/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, ... }: -{ - home-manager.users."${config.sysusers.main}".home = { - desktop.enable = true; - stateVersion = lib.mkForce config.system.stateVersion; - }; -} diff --git a/modules/system/accounts/users/custom/main/default.nix b/modules/system/accounts/users/custom/main/default.nix index a179a5a..2dd9a6d 100644 --- a/modules/system/accounts/users/custom/main/default.nix +++ b/modules/system/accounts/users/custom/main/default.nix @@ -20,7 +20,6 @@ ../../../../../../hosts/kitty/id_ed25519.pub ../../../../../../hosts/midas/id_ed25519.pub ../../../../../../hosts/prophet/id_ed25519.pub - ../../../../../../hosts/rubble/id_ed25519.pub ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9" diff --git a/modules/system/devices/disks/filesystems/default.nix b/modules/system/devices/disks/filesystems/default.nix index be9bebf..c4f79ed 100644 --- a/modules/system/devices/disks/filesystems/default.nix +++ b/modules/system/devices/disks/filesystems/default.nix @@ -1,9 +1,9 @@ -{ pkgs, ... }: +{ config, lib, ... }: { boot.supportedFilesystems = { btrfs = true; ntfs = true; - zfs = true; + zfs = lib.mkIf config.system.server.enable true; }; services = {