Prime prove con Colmena

This commit is contained in:
pazpi 2024-07-15 19:23:49 +02:00
parent 9f1ba4a64b
commit 1000a3de75
4 changed files with 159 additions and 16 deletions

83
flake.lock generated Normal file
View file

@ -0,0 +1,83 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1718530513,
"narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a1fddf0967c33754271761d91a3d921772b30d0e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1719487696,
"narHash": "sha256-pCsl9qFCuIuhIfGH03CiBOsy1LNwITC6VMb6/5tz+Qc=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "14aadcba1a26c8c142453839f888afd0db8b2041",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719426051,
"narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},
"root": "root",
"version": 7
}

View file

@ -15,24 +15,84 @@
}; };
}; };
outputs = outputs = { self, nixpkgs, home-manager, ... }@flakeInputs:
{ self let
, nixpkgs system = "x86_64-linux";
, home-manager pkgs = import nixpkgs {
, ... inherit system;
}@inputs: };
in
{ {
nixosConfigurations = {
deadbeef = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/deadbeef
];
specialArgs = inputs; 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
# ];
# };
# };
} }

View file

@ -2,8 +2,8 @@
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
home-manager.nixosModules.home-manager # home-manager.nixosModules.home-manager
../../modules # ../../modules
# "${config.inputs.self}/modules" # "${config.inputs.self}/modules"
]; ];

View file

@ -8,7 +8,7 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
oci-containers.pods.download = { }; nixfiles.oci-containers.pods.download = { };
}; };