From d64d03a54f05e44dcdef93e4de8e6500f1d571e0 Mon Sep 17 00:00:00 2001 From: pazpi Date: Mon, 15 Jul 2024 22:55:54 +0200 Subject: [PATCH] Prove --- flake.nix | 210 +++++++++++++++++++++++++++++------------------------- 1 file changed, 112 insertions(+), 98 deletions(-) diff --git a/flake.nix b/flake.nix index 17df32d..37839f2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,98 +1,112 @@ -{ - description = "Pazpi's systems"; - - inputs = { - - # NixOS related inputs - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - - home-manager = { - url = "github:nix-community/home-manager/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { self, nixpkgs, home-manager, ... }@flakeInputs: - let - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - }; - in - { - - colmena = { - meta = { - nixpkgs = import nixpkgs { - inherit system; - overlays = []; - }; - }; - - deadbeef = { - deployment = { - targetHost = "somehost.tld"; - targetPort = 1234; - targetUser = "luser"; - }; -boot.isContainer = true; - time.timeZone = "America/Los_Angeles"; - - }; - - }; - - - formatter.${system} = pkgs.nixpkgs-fmt; - - nixosConfigurations = - let - mkNixosConfiguration = name: extraModules: nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { inherit flakeInputs; }; - modules = [ - { - networking.hostName = name; - nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ]; - # sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml; - } - ./modules - (./hosts + "/${name}") - # (./hosts + "/${name}" + /hardware.nix) - # sops-nix.nixosModules.sops - ] ++ extraModules; - }; - in - { - deadbeef = mkNixosConfiguration "deadbeef" [ ]; - # nyarlathotep = mkNixosConfiguration "nyarlathotep" [ "${nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ]; - }; - }; - - - - # formatter.${system} = pkgs.nixpkgs-fmt; - - # nixosConfigurations = { - - # deadbeef = nixpkgs.lib.nixosSystem { - # # inherit system; - # system = "x86_64-linux"; - # specialArgs = { inherit inputs; }; - - # modules = [ - # { - # networking.hostName = "deadbeef"; - # nixpkgs.overlays = [ (_: _: { nixfiles = self.packages."x86_64-linux"; }) ]; - # } - # ./hosts/deadbeef - # ]; - - - # }; - # }; - -} +{ + description = "Pazpi's systems"; + + inputs = { + + # NixOS related inputs + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, ... }@flakeInputs: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + }; + in + { + + colmena = { + meta = { + nixpkgs = import nixpkgs { + inherit system; + overlays = [ ]; + }; + }; + + childnixos = { + deployment = { + targetHost = "10.42.135.101"; + targetPort = 22; + targetUser = "root"; + }; + + imports = [ ./lxc-nix/configuration.nix ]; + }; + + # deadbeef = { + # deployment = { + # targetHost = "10.42.135.101"; + # targetPort = 22; + # targetUser = "root"; + # }; + + + + # boot.isContainer = true; + # time.timeZone = "Europe/Rome"; + # environment.systemPackages = with pkgs; [ htop ]; + + # }; + + }; + + + formatter.${system} = pkgs.nixpkgs-fmt; + + nixosConfigurations = + let + mkNixosConfiguration = name: extraModules: nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit flakeInputs; }; + modules = [ + { + networking.hostName = name; + nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ]; + # sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml; + } + ./modules + (./hosts + "/${name}") + # (./hosts + "/${name}" + /hardware.nix) + # sops-nix.nixosModules.sops + ] ++ extraModules; + }; + in + { + deadbeef = mkNixosConfiguration "deadbeef" [ ]; + # nyarlathotep = mkNixosConfiguration "nyarlathotep" [ "${nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ]; + }; + }; + + + + # formatter.${system} = pkgs.nixpkgs-fmt; + + # nixosConfigurations = { + + # deadbeef = nixpkgs.lib.nixosSystem { + # # inherit system; + # system = "x86_64-linux"; + # specialArgs = { inherit inputs; }; + + # modules = [ + # { + # networking.hostName = "deadbeef"; + # nixpkgs.overlays = [ (_: _: { nixfiles = self.packages."x86_64-linux"; }) ]; + # } + # ./hosts/deadbeef + # ]; + + + # }; + # }; + +}