init commit
This commit is contained in:
commit
8f7a75814d
21 changed files with 1073 additions and 0 deletions
55
modules/flake/deploy.nix
Normal file
55
modules/flake/deploy.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ inputs, ... }:
|
||||
let
|
||||
inherit (inputs)
|
||||
self
|
||||
deploy-rs
|
||||
nixpkgs
|
||||
nixos-anywhere
|
||||
agenix
|
||||
;
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
genNode =
|
||||
hostName: nixosCfg:
|
||||
let
|
||||
# inherit (self.hosts.${hostName}) address hostPlatform remoteBuild;
|
||||
# inherit (deploy-rs.lib.${hostPlatform}) activate;
|
||||
system = self.nixosConfigurations."${hostName}".pkgs.system;
|
||||
in
|
||||
{
|
||||
hostname = hostName;
|
||||
profiles.system.path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||
};
|
||||
in
|
||||
{
|
||||
perSystem =
|
||||
{
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
apps = rec {
|
||||
default = deploy;
|
||||
secrets = {
|
||||
type = "app";
|
||||
program = "${agenix.packages.${system}.agenix}/bin/agenix";
|
||||
meta.description = "";
|
||||
};
|
||||
install = {
|
||||
type = "app";
|
||||
program = "${nixos-anywhere.packages.${system}.nixos-anywhere}/bin/nixos-anywhere";
|
||||
meta.description = "";
|
||||
};
|
||||
deploy = deploy-rs.apps.${system}.deploy-rs;
|
||||
};
|
||||
};
|
||||
flake = {
|
||||
deploy = {
|
||||
autoRollback = false;
|
||||
magicRollback = true;
|
||||
user = "root";
|
||||
remoteBuild = true;
|
||||
nodes = lib.mapAttrs genNode (self.nixosConfigurations or { });
|
||||
};
|
||||
};
|
||||
}
|
||||
12
modules/flake/devshell.nix
Normal file
12
modules/flake/devshell.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
perSystem = { pkgs, ... }: {
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "nixos-unified-template-shell";
|
||||
meta.description = "Shell environment for modifying this Nix configuration";
|
||||
packages = with pkgs; [
|
||||
just
|
||||
nixd
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/flake/toplevel.nix
Normal file
16
modules/flake/toplevel.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Top-level flake glue to get our configuration working
|
||||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nixos-unified.flakeModules.default
|
||||
inputs.nixos-unified.flakeModules.autoWire
|
||||
];
|
||||
perSystem = { self', pkgs, ... }: {
|
||||
# For 'nix fmt'
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
|
||||
# Enables 'nix run' to activate.
|
||||
packages.default = self'.packages.activate;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue