diff options
author | Karel Kočí <cynerd@email.cz> | 2022-02-21 21:54:09 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-06-10 14:05:48 +0200 |
commit | 93b0545d11bf8c7f065203f7f3eaf1d0e3730dce (patch) | |
tree | da93fa5fcd14c493d8ccd86c98f40d26c9697869 /flake.nix | |
download | nixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.tar.gz nixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.tar.bz2 nixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.zip |
Add initial version
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d39fbff --- /dev/null +++ b/flake.nix @@ -0,0 +1,80 @@ +{ + description = "Cynerd's personal flake"; + + inputs = { + shellrc.url = "git+https://git.cynerd.cz/shellrc"; + nixturris.url = "git+https://git.cynerd.cz/nixturris"; + personal-secret.url = "git+ssh://git@cynerd.cz/nixos-personal-secret"; + + #sterm.url = "github:wentasah/sterm"; + sterm.url = "github:cynerd/sterm/comp"; + }; + + outputs = { self + , nixpkgs, flake-utils + , shellrc, nixturris, personal-secret + , sterm + }: + with flake-utils.lib; + { + overlays.default = final: prev: import ./pkgs { nixpkgs = prev; }; + nixosModules = import ./nixos nixpkgs; + + nixosConfigurations = let + + modules = hostname: [ + self.nixosModules.default + self.nixosModules."machine-${hostname}" + shellrc.nixosModule + (personal-secret.lib.personalSecrets hostname) + { + networking.hostName = hostname; + nixpkgs.overlays = [ + self.overlays.default + sterm.overlay + ]; + } + ]; + + genericSystem = system: hostname: { + ${hostname} = nixpkgs.lib.nixosSystem { + system = system; + modules = modules hostname; + }; + }; + amd64System = genericSystem "x86_64-linux"; + armv7lSystem = genericSystem "armv7l-linux"; + aarch64System = genericSystem "aarch64-linux"; + + turrisSystem = board: hostname: { + ${hostname} = nixturris.lib.nixturrisSystem { + nixpkgs = nixpkgs; + board = board; + modules = modules hostname; + }; + }; + turrisMoxSystem = turrisSystem "mox"; + turrisOmniaSystem = turrisSystem "omnia"; + + in + amd64System "albert" // + amd64System "binky" // + amd64System "errol" // + amd64System "lipwig" // + amd64System "ridcully" // + amd64System "susan" // + armv7lSystem "spt-mpd" // + aarch64System "adm-mpd" // + turrisOmniaSystem "spt-omnia" // + turrisMoxSystem "spt-mox" // + turrisMoxSystem "spt-mox2" // + turrisOmniaSystem "adm-omnia" // + turrisOmniaSystem "adm-omnia2"; + + } // eachDefaultSystem (system: { + packages = filterPackages system (flattenTree ( + import ./pkgs { nixpkgs = nixpkgs.legacyPackages."${system}"; } + )); + }); + +} |