This commit is contained in:
Ingolf Wagner 2021-09-24 06:09:20 +02:00
parent e466eec0e3
commit 819ffd673c
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 135 additions and 0 deletions

25
configuration.nix Normal file
View file

@ -0,0 +1,25 @@
{ nixosSystem, home-manager, lib, nixpkgs-unstable, ... }: {
sterni = nixosSystem {
system = "x86_64-linux";
modules = [
./configs/sterni/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
({ pkgs, ... }: {
# defined overlays injected by the nixflake
nixpkgs.overlays = [
(_self: _super: {
# we assign the overlay created before to the overlays of nixpkgs.
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
})
];
# imports of modules
imports = [ <backup-module> <krops-lib> <cluster-module> <modules> ];
})
];
};
}

50
flake.nix Normal file
View file

@ -0,0 +1,50 @@
{
description = "my krops file";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nix-doom-emacs = {
url = "github:vlaci/nix-doom-emacs";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-21.05";
inputs.nixpkgs.follows = "nixpkgs";
};
krops = {
url = "github:Mic92/krops";
#url = "file:/home/palo/dev/krops-mic92-fork";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, krops, flake-utils, nix-doom-emacs
, nixpkgs-unstable, ... }:
(flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
writeCommand = krops.packages.${system}.writeCommand;
in {
# deploy like this:
# nix run ".#deploy.sterni"
apps.deploy = pkgs.callPackage ./krops.nix {
inherit writeCommand;
lib = krops.lib;
};
})) // {
nixosConfigurations = import ./configurations.nix {
nixosSystem = nixpkgs.lib.nixosSystem;
inherit home-manager nixpkgs-unstable lib;
};
};
}

60
krops.nix Normal file
View file

@ -0,0 +1,60 @@
{ writeCommand, lib, ... }:
let
secrets = name: {
secrets.pass = {
dir = toString ~/.password-store;
name = "krops/${name}/secrets";
};
common_secrets.pass = {
dir = toString ~/.password-store;
name = "krops/common_secrets";
};
};
desktopSecrets = {
desktop_secrets.pass = {
dir = toString ~/.password-store;
name = "krops/desktop_secrets";
};
};
source = {
# only workhorse
# property.file = toString ./submodules/property;
assets.file = toString ./assets;
configs.file = toString ./configs;
library.file = toString ./library;
modules.file = toString ./modules;
#mqtt.file = toString ./mqtt;
pkgs.file = toString ./pkgs;
system.file = toString ./system;
#backup-module.file = toString ~/dev/backup;
backup-module.git = {
url = "https://git.ingolf-wagner.de/nix-modules/backup.git";
ref = "1.3.3";
};
#kops-lib.file = toString ~/dev/krops-lib;
krops-lib.git = {
url = "https://git.ingolf-wagner.de/nix-modules/krops.git";
ref = "1.0.3";
};
#cluster-module.file = toString ~/dev/cluster-module;
cluster-module.git = {
url = "https://git.ingolf-wagner.de/nix-modules/cluster.git";
ref = "1.2.0";
};
};
in {
sterni = writeCommand "deploy-sterni" {
source = source // (secrets "sterni") // desktopSecrets;
target = lib.mkTarget "root@sterni.private";
};
}