diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-07-18 08:06:34 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-07-18 08:06:34 -0400 |
commit | 28ba21c54e5d6bfa9d36d16b53cfbfac38d70746 (patch) | |
tree | c8a238b1f1906e5d27d41831592143bf57006697 | |
parent | 0e239e4d2cf4367a1fc57b27d55af213fb43c484 (diff) |
update config
-rw-r--r-- | flake.nix | 88 |
1 files changed, 39 insertions, 49 deletions
@@ -1,7 +1,7 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - inputs.nixos-hardware.url = github:NixOS/nixos-hardware/master; + inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master"; inputs.home-manager.url = "github:rycee/home-manager/master"; inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -12,7 +12,7 @@ outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager }: let - pkgs-module = {config, ...}: + pkgs-module = { config, ... }: let cfg = config.nixpkgs; @@ -22,76 +22,66 @@ }; }; in { - nixpkgs.pkgs = import nixpkgs { - inherit (cfg) config localSystem crossSystem; - overlays = cfg.overlays ++ [ unstable-overlay ]; + nixpkgs.pkgs = import nixpkgs { + inherit (cfg) config localSystem crossSystem; + overlays = cfg.overlays ++ [ unstable-overlay ]; + }; }; - }; lib = nixpkgs.lib; - orbekk-modules = - let - moduleFiles = - lib.attrNames ( - lib.filterAttrs - (n: v: lib.hasSuffix ".nix" n && v == "regular") - (builtins.readDir ./modules)); + orbekk-modules = let + moduleFiles = lib.attrNames + (lib.filterAttrs (n: v: lib.hasSuffix ".nix" n && v == "regular") + (builtins.readDir ./modules)); - moduleNames = map (lib.removeSuffix ".nix") moduleFiles; + moduleNames = map (lib.removeSuffix ".nix") moduleFiles; - mkModule = name: { - inherit name; - value = import (./. + "/modules/${name}.nix"); - }; - in lib.listToAttrs (map mkModule moduleNames); - - in - { - nixosModules = - orbekk-modules // { - inherit pkgs-module; + mkModule = name: { + inherit name; + value = import (./. + "/modules/${name}.nix"); }; + in lib.listToAttrs (map mkModule moduleNames); + + in { + nixosModules = orbekk-modules // { inherit pkgs-module; }; packages."x86_64-linux" = - let - pkgs = import nixpkgs { - system = "x86_64-linux"; - }; - in - {}; + let pkgs = import nixpkgs { system = "x86_64-linux"; }; + in { }; nixosConfigurations = let - mkConfig = { hostName - , module ? (./. + "/machines/${hostName}.nix") - , system ? "x86_64-linux" }: { - name = hostName; - value = lib.nixosSystem { - inherit system; + mkConfig = { hostName, module ? (./. + "/machines/${hostName}.nix") + , system ? "x86_64-linux" }: { + name = hostName; + value = lib.nixosSystem { + inherit system; - modules = - (lib.attrValues self.nixosModules) ++ - [ + modules = (lib.attrValues self.nixosModules) ++ [ pkgs-module module nixpkgs.nixosModules.notDetected - ({config, pkgs, ...}: { + ({ config, pkgs, ... }: { # Let 'nixos-version --json' know about the Git revision # of this flake. - system.configurationRevision = - let - lastModified = pkgs.lib.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101"); - in - "${lastModified}.${self.shortRev or "dirty"}"; + system.configurationRevision = let + lastModified = pkgs.lib.substring 0 8 + (self.lastModifiedDate or self.lastModified or "19700101"); + in "${lastModified}.${self.shortRev or "dirty"}"; }) ]; + }; }; - }; myMachines = [ - { hostName = "pincer"; module = ./machines/x1-pincer.nix; } + { + hostName = "pincer"; + module = ./machines/x1-pincer.nix; + } { hostName = "dragon"; } { hostName = "firelink"; } - { hostName = "gutter"; } + { + hostName = "tiny1"; + } # { hostName = "testvm"; module = { # users.users.orbekk.initialHashedPassword = ""; # }; } |