diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..706c41f --- /dev/null +++ b/common.nix @@ -0,0 +1,16 @@ +# Holds common settings for all systems. + +{ ... }: { + + nix = { + optimise.automatic = true; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + nixpkgs.config.allowUnfree = true; + + boot.cleanTmpDir = true; + +} diff --git a/flake.lock b/flake.lock index 6ea6392..ecc6bd2 100644 --- a/flake.lock +++ b/flake.lock @@ -34,16 +34,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1652623270, - "narHash": "sha256-DZXGCio58hPeBHVk9o0khafZav23jpOIm4QpbJZThpw=", + "lastModified": 1611574965, + "narHash": "sha256-IYtGS077nJFIqSq6Cb8WEJwbqqd4K7S4vUuwPZKfLeo=", "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d595d207baa598ca62a2da003a96510529fec9e4", + "repo": "nixpkgs-channels", + "rev": "4762fba469e2baa82f983b262e2c06ac2fdaae67", "type": "github" }, "original": { "owner": "NixOS", - "repo": "nixpkgs", + "ref": "nixos-unstable", + "repo": "nixpkgs-channels", "type": "github" } }, diff --git a/flake.nix b/flake.nix index d17ec9c..ef1e1d4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,35 @@ { inputs = { - nixpkgs.url = github:NixOS/nixpkgs; - home-manager.url = github:nix-community/home-manager; + + nixpkgs = { + url = github:NixOS/nixpkgs-channels/nixos-unstable; + }; + + home-manager = { + url = github:nix-community/home-manager; + }; + }; - outputs = { self, nixpkgs, home-manager }: with nixpkgs; { - nixosConfigurations."thor" = lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./configuration.nix ]; + outputs = args: with args.nixpkgs; { + nixosConfigurations = { + "thor" = lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./machines/thor/configuration.nix + ./common.nix + ]; + specialArgs = args; + }; + "loki" = lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./machines/loki/configuration.nix + ./common.nix + ]; + specialArgs = args; + }; }; }; diff --git a/machines/thor/configuration.nix b/machines/thor/configuration.nix index 460621b..b4dcc9b 100644 --- a/machines/thor/configuration.nix +++ b/machines/thor/configuration.nix @@ -11,6 +11,8 @@ kak.ide = true; }; + system.stateVersion = "21.11"; + networking = { hostName = "thor"; interfaces.enp9s0.useDHCP = true; diff --git a/modules/default.nix b/modules/default.nix index d80a65a..e3867a1 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,6 @@ -# Global config +# Modules used by most systems. -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, home-manager, ... }: with lib; with types; let named = submodule { @@ -104,7 +104,7 @@ let named = submodule { imports = [ - + home-manager.nixosModule ./kak ./gui @@ -189,8 +189,6 @@ let named = submodule { loader.efi = { canTouchEfiVariables = true; }; - - cleanTmpDir = true; }; networking = { @@ -198,7 +196,6 @@ let named = submodule { useDHCP = false; }; - nixpkgs.config.allowUnfree = true; security.rtkit.enable = true; users.users."riley" = { @@ -206,12 +203,5 @@ let named = submodule { extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. }; - nix = { - optimise.automatic = true; - extraOptions = '' - experimental-features = nix-command flakes - ''; - }; - }; } diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..30f4233 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,4 @@ +# Scripts + +This directory contains nix derivations for shell scripts I want to use across +devices.