Compare commits
5 Commits
cf2ba8731d
...
9a8f98d4fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a8f98d4fe | ||
|
|
30ffa5f234 | ||
|
|
c3e80bb91a | ||
|
|
7a5c96284f | ||
|
|
ee1b2aafba |
10
README.md
10
README.md
@@ -15,7 +15,15 @@ nix flake show --all-systems
|
||||
## Layout
|
||||
|
||||
- Everything under `./modules` gets auto-imported by `import-tree`
|
||||
-
|
||||
|
||||
| Directory | Description |
|
||||
| ------------- | ----------- |
|
||||
| `hosts` | Provides either `homeConfigurations` or `nixosConfigurations` |
|
||||
| `nix-tools` | Nix-specific tools, like factory functions for use in the flakes |
|
||||
| `nixos` | `flake.modules.nixos` |
|
||||
| `programs` | flakes that provide `flake.modules` attributes for specific programs |
|
||||
| `services` | flakes that provide configuration for running services |
|
||||
| `users` | flakes that provide configuration for individual users with the `flake.factory.user` factory |
|
||||
|
||||
## Mechanics
|
||||
|
||||
|
||||
@@ -10,13 +10,11 @@ in
|
||||
{
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
rebuild
|
||||
zsh
|
||||
john
|
||||
desktop
|
||||
docker
|
||||
ssh
|
||||
resticprofile
|
||||
sops
|
||||
docker
|
||||
desktop
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
@@ -52,8 +50,8 @@ in
|
||||
default = {
|
||||
"inherit" = "base";
|
||||
repository = "rest:https://soteria.john-stream.com/john-ubuntu";
|
||||
cacert = "${config.home.homeDirectory}/.step/certs/root_ca.crt";
|
||||
tls-client-cert = "${config.home.homeDirectory}/.step/certs/mtls.pem";
|
||||
# cacert = "${config.home.homeDirectory}/.step/certs/root_ca.crt";
|
||||
# tls-client-cert = "${config.home.homeDirectory}/.step/certs/mtls.pem";
|
||||
backup = {
|
||||
source = [
|
||||
"${config.xdg.userDirs.documents}"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
home-manager.users."${username}" = {
|
||||
imports = [
|
||||
self.modules.homeManager."${username}"
|
||||
# self.modules.homeManager.shell-tools
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -26,9 +27,10 @@
|
||||
homeManager."${username}" = {
|
||||
home.username = "${username}";
|
||||
home.homeDirectory = "/home/${username}";
|
||||
imports = with self.modules.homeManager; [
|
||||
base
|
||||
];
|
||||
# TODO: This doesn't get merged properly when the factory gets used
|
||||
# imports = with self.modules.homeManager; [
|
||||
# shell-tools
|
||||
# ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
flake.modules.homeManager.base = { pkgs, ... }:
|
||||
{
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
git
|
||||
shell-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
bash
|
||||
# zsh
|
||||
zsh
|
||||
|
||||
# Tools
|
||||
eza
|
||||
|
||||
42
modules/services/restic/base-profile.yaml
Normal file
42
modules/services/restic/base-profile.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
base:
|
||||
repository: local:/mnt/backup
|
||||
password-file: '{{ .ConfigDir }}/password.txt'
|
||||
status-file: '{{ .ConfigDir }}/backup-status.json'
|
||||
retention:
|
||||
after-backup: true
|
||||
keep-last: '10'
|
||||
keep-hourly: '8'
|
||||
keep-daily: '14'
|
||||
keep-weekly: '8'
|
||||
backup:
|
||||
verbose: true
|
||||
exclude:
|
||||
- .cache
|
||||
- .devenv
|
||||
- .rustup
|
||||
- .cargo
|
||||
- .venv
|
||||
- .pyenv
|
||||
- .vscode*
|
||||
- data/postgres
|
||||
- build
|
||||
- __pycache__
|
||||
- '*.log'
|
||||
- '*.egg-info'
|
||||
- '*.csv'
|
||||
- '*.m4a'
|
||||
- .local/share/Steam
|
||||
- .local/share/Trash
|
||||
- build
|
||||
- dist
|
||||
- /home/*/Pictures
|
||||
- /home/*/Videos
|
||||
- /home/*/go
|
||||
- /home/*/snap
|
||||
- /home/john/john-nas
|
||||
schedule-permission: user
|
||||
schedule-priority: background
|
||||
check-after: true
|
||||
prune:
|
||||
schedule-permission: user
|
||||
schedule-lock-wait: 1h
|
||||
@@ -1,42 +0,0 @@
|
||||
base:
|
||||
repository: local:/mnt/backup
|
||||
password-file: '{{ .ConfigDir }}/password.txt'
|
||||
status-file: '{{ .ConfigDir }}/backup-status.json'
|
||||
retention:
|
||||
after-backup: true
|
||||
keep-last: '10'
|
||||
keep-hourly: '8'
|
||||
keep-daily: '14'
|
||||
keep-weekly: '8'
|
||||
backup:
|
||||
verbose: true
|
||||
exclude:
|
||||
- .cache
|
||||
- .devenv
|
||||
- .rustup
|
||||
- .cargo
|
||||
- .venv
|
||||
- .pyenv
|
||||
- .vscode*
|
||||
- data/postgres
|
||||
- build
|
||||
- __pycache__
|
||||
- '*.log'
|
||||
- '*.egg-info'
|
||||
- '*.csv'
|
||||
- '*.m4a'
|
||||
- .local/share/Steam
|
||||
- .local/share/Trash
|
||||
- build
|
||||
- dist
|
||||
- /home/*/Pictures
|
||||
- /home/*/Videos
|
||||
- /home/*/go
|
||||
- /home/*/snap
|
||||
- /home/john/john-nas
|
||||
schedule-permission: user
|
||||
schedule-priority: background
|
||||
check-after: true
|
||||
prune:
|
||||
schedule-permission: user
|
||||
schedule-lock-wait: 1h
|
||||
@@ -29,12 +29,25 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.lib.fromYAML = pkgs: path:
|
||||
builtins.fromJSON (
|
||||
builtins.readFile (
|
||||
pkgs.runCommand "${builtins.baseNameOf path}.json"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.remarshal ];
|
||||
}
|
||||
''
|
||||
remarshal -if yaml -of json ${path} > "$out"
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
flake.modules.homeManager.resticprofile = { config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.programs.resticprofile;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
baseProfile = import ../../../resticprofile/base.nix;
|
||||
# baseProfile = builtins.fromJSON (builtins.readFile ./base.yaml)
|
||||
# baseProfile = import ../../../resticprofile/base.nix;
|
||||
baseProfile = inputs.self.lib.fromYAML pkgs ./base-profile.yaml;
|
||||
profiles = lib.recursiveUpdate baseProfile cfg.profiles;
|
||||
in {
|
||||
options.programs.resticprofile = {
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
modules = lib.mkMerge [
|
||||
modules = lib.recursiveUpdate
|
||||
(inputs.self.factory.user username true)
|
||||
{
|
||||
#
|
||||
@@ -41,10 +41,11 @@ in
|
||||
programs.git.settings.user.email = email;
|
||||
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
# base
|
||||
ssh
|
||||
shell-tools
|
||||
git
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user