diff options
author | stuebinm | 2022-01-27 01:08:56 +0100 |
---|---|---|
committer | stuebinm | 2022-01-27 01:08:56 +0100 |
commit | 11f1f6ff22d917797dfba62089c45249b9699dc8 (patch) | |
tree | 084786d7549c4fa59bf8e56f945da3ee148e8489 | |
parent | 7c39ebf750ccf6598d4a63481fb021e7b5217e86 (diff) |
might be that I'm using deploy-rs now??
dunno it's kinda weird but i guess i can play around with it some 🤷♀️
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 105 |
1 files changed, 52 insertions, 53 deletions
@@ -1,29 +1,26 @@ + { description = "testing nix flakes for server deployment"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/release-21.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - uplcg = { - url = "git+https://stuebinm.eu/git/uplcg?ref=main"; - flake = false; - }; - tracktrain = { - url = "git+https://stuebinm.eu/git/tracktrain?ref=main"; - flake = false; - }; - blog = { - url = "path:/home/stuebinm/Dokumente/blog"; - flake = false; - }; - home-manager = { - url = "github:nix-community/home-manager/release-21.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - playground.url = "git+https://stuebinm.eu/git/playground"; - playground.flake = false; + + home-manager.url = "github:nix-community/home-manager/release-21.11"; + home-manager.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"; + + uplcg.url = "git+https://stuebinm.eu/git/uplcg?ref=main"; + uplcg.flake = false; + tracktrain.url = "git+https://stuebinm.eu/git/tracktrain?ref=main"; + tracktrain.flake = false; + blog.url = "path:/home/stuebinm/Dokumente/blog"; + blog.flake = false; + playground.url = "git+https://stuebinm.eu/git/playground"; + playground.flake = false; sfz.url = "github:weihanglo/sfz"; sfz.flake = false; almanac.url = "path:/home/stuebinm/clones/almanac"; @@ -31,50 +28,52 @@ feeds.url = "path:/home/stuebinm/nonpublic.nix"; feeds.flake = false; - deploy-rs.url = "github:serokell/deploy-rs"; - deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, deploy-rs, ... }@inputs: - let - mkConfig = imports: config: - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ config ] ++ imports; + 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 ]; - in { - - nixosConfigurations = { - chaski = mkServer ./chaski/configuration.nix; - flora = mkServer ./flora/configuration.nix; - abbenay = mkDesktop ./abbenay/configuration.nix; - cyberbox = mkDesktop ./cyberbox/configuration.nix; - }; - - - deploy.nodes.chaski.profiles.system = { + specialArgs = { inherit inputs; }; + }; + mkServer = mkConfig [ ./common/headless.nix ]; + mkDesktop = mkConfig [ ./common/desktop.nix ]; + deploy-vps = hostname: { + inherit hostname; + profiles.system = { user = "root"; sshUser = "root"; - path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.chaski; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname}; }; - deploy.nodes.chaski.hostname = "chaski"; + }; + in { + + nixosConfigurations = { + chaski = mkServer ./chaski/configuration.nix; + flora = mkServer ./flora/configuration.nix; + abbenay = mkDesktop ./abbenay/configuration.nix; + cyberbox = mkDesktop ./cyberbox/configuration.nix; + }; - checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; + deploy.nodes = { + chaski = deploy-vps "chaski"; + flora = deploy-vps "flora"; + }; - homeConfigurations.stuebinm = - inputs.home-manager.lib.homeManagerConfiguration rec { - system = "x86_64-linux"; - homeDirectory = "/home/stuebinm"; - username = "stuebinm"; - configuration.imports = [ ./home/home.nix ]; - stateVersion = "21.03"; - extraSpecialArgs = { inherit inputs system; }; - }; + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; - home = self.homeConfigurations.stuebinm.activationPackage; + homeConfigurations.stuebinm = inputs.home-manager.lib.homeManagerConfiguration rec { + system = "x86_64-linux"; + homeDirectory = "/home/stuebinm"; + username = "stuebinm"; + configuration.imports = [ ./home/home.nix ]; + stateVersion = "21.03"; + extraSpecialArgs = { inherit inputs system; }; }; + + home = self.homeConfigurations.stuebinm.activationPackage; + }; } |