{ description = "testing nix flakes for server deployment"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/release-22.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; home-manager.url = "github:nix-community/home-manager/release-22.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; peerix.url = "github:cid-chan/peerix"; peerix.inputs.nixpkgs.follows = "nixpkgs"; naersk.url = "github:nix-community/naersk"; naersk.inputs.nixpkgs.follows = "nixpkgs"; deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; uplcg.url = "git+https://stuebinm.eu/git/uplcg?ref=main"; uplcg.flake = false; tracktrain.url = "git+https://stuebinm.eu/git/tracktrain?rev=48c42f93b040e0a27037c1a6728dd9dc2bd4f573&ref=main"; tracktrain.flake = false; blog.url = "path:/home/stuebinm/projects/blog?rev=61d09465b5285f4c5d5420cc9aa3f483072fb765"; blog.flake = false; playground.url = "git+https://stuebinm.eu/git/playground"; playground.flake = false; traveltext.url = "git+https://stuebinm.eu/git/traveltext?ref=main"; traveltext.flake = false; sfz.url = "github:weihanglo/sfz"; sfz.flake = false; almanac.url = "git+https://stuebinm.eu/git/almanac"; almanac.flake = false; feeds.url = "path:/home/stuebinm/nonpublic.nix"; feeds.flake = false; gtfsBooks.url = "git+https://stuebinm.eu/git/gtfs-books?ref=main"; gtfsBooks.flake = false; walint.url = "git+https://stuebinm.eu/git/walint?ref=playground"; walint.flake = false; }; outputs = { self, nixpkgs, deploy-rs, peerix, nixos-hardware, ... }@inputs: let mkConfig = imports: config: nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ config ] ++ imports; specialArgs = { inherit inputs; }; }; mkServer = mkConfig [ ./common/headless.nix ]; mkDesktop = mkConfig [ ./common/desktop.nix peerix.nixosModules.peerix ]; deploy-vps = hostname: { inherit hostname; profiles.system = { user = "root"; sshUser = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname}; }; }; in { nixosConfigurations = { chaski = mkServer ./chaski/configuration.nix; flora = mkServer ./flora/configuration.nix; abbenay = mkDesktop ./abbenay/configuration.nix; cyberbox = mkDesktop ./cyberbox/configuration.nix; surltesh-echer = mkDesktop ./surltesh-echer/configuration.nix; }; deploy.nodes = { chaski = deploy-vps "chaski"; flora = deploy-vps "flora"; }; checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; homeConfigurations = let home = root: inputs.home-manager.lib.homeManagerConfiguration rec { system = "x86_64-linux"; homeDirectory = "/home/stuebinm"; username = "stuebinm"; configuration.imports = [ root ]; stateVersion = "21.03"; extraSpecialArgs = { inherit inputs system; }; }; in { stuebinm = home ./home/home.nix; stuebinm-minimal = home ./home/home-minimal.nix; }; home = self.homeConfigurations.stuebinm.activationPackage; home-minimal = self.homeConfigurations.stuebinm-minimal.activationPackage; }; }