summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix105
1 files changed, 52 insertions, 53 deletions
diff --git a/flake.nix b/flake.nix
index 017b7b9..5549885 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;
+ };
}