Compare commits
10 commits
3d0e5063ac
...
74f03555e5
Author | SHA1 | Date | |
---|---|---|---|
teutat3s | 74f03555e5 | ||
b12f | e1dadd17ab | ||
Hendrik Sokolowski | 31eb82a4e7 | ||
Hendrik Sokolowski | 6c9434d3a0 | ||
Hendrik Sokolowski | 3451e9dead | ||
b12f | c469a8a2dc | ||
b12f | eb337ddd47 | ||
b12f | f96b31a8a9 | ||
teutat3s | b6be95d032 | ||
teutat3s | 50eb1d4f32 |
24
flake.lock
24
flake.lock
|
@ -14,11 +14,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722339003,
|
||||
"narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=",
|
||||
"lastModified": 1723293904,
|
||||
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7",
|
||||
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -299,11 +299,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722924007,
|
||||
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=",
|
||||
"lastModified": 1724299755,
|
||||
"narHash": "sha256-P5zMA17kD9tqiqMuNXwupkM7buM3gMNtoZ1VuJTRDE4=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705",
|
||||
"rev": "a8968d88e5a537b0491f68ce910749cd870bdbef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -330,11 +330,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1722869614,
|
||||
"narHash": "sha256-7ojM1KSk3mzutD7SkrdSflHXEujPvW1u7QuqWoTLXQU=",
|
||||
"lastModified": 1724242322,
|
||||
"narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
|
||||
"rev": "224042e9a3039291f22f4f2ded12af95a616cca0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -519,11 +519,11 @@
|
|||
},
|
||||
"unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1722813957,
|
||||
"narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
19
flake.nix
19
flake.nix
|
@ -79,14 +79,25 @@
|
|||
master = import inputs.master { inherit system; };
|
||||
};
|
||||
|
||||
packages = let
|
||||
packages =
|
||||
let
|
||||
nixos-lib = import (inputs.nixpkgs + "/nixos/lib") { };
|
||||
testDir = builtins.attrNames (builtins.readDir ./tests);
|
||||
testFiles = builtins.filter (n: builtins.match "^.*.nix$" n != null) testDir;
|
||||
in builtins.listToAttrs (map (x: {
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
map (x: {
|
||||
name = "test-${lib.strings.removeSuffix ".nix" x}";
|
||||
value = nixos-lib.runTest (import (./tests + "/${x}") { inherit self; inherit pkgs; inherit lib; inherit config; });
|
||||
}) testFiles);
|
||||
value = nixos-lib.runTest (
|
||||
import (./tests + "/${x}") {
|
||||
inherit self;
|
||||
inherit pkgs;
|
||||
inherit lib;
|
||||
inherit config;
|
||||
}
|
||||
);
|
||||
}) testFiles
|
||||
);
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
|
|
|
@ -7,11 +7,16 @@
|
|||
}:
|
||||
{
|
||||
options.pub-solar-os.backups = {
|
||||
stores = with lib; mkOption {
|
||||
stores =
|
||||
with lib;
|
||||
mkOption {
|
||||
description = ''
|
||||
Periodic backups to create with Restic.
|
||||
'';
|
||||
type = types.attrsOf (types.submodule ({ name, ... }: {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
passwordFile = mkOption {
|
||||
type = types.str;
|
||||
|
@ -30,7 +35,9 @@
|
|||
example = "sftp:backup@192.168.1.100:/backups/${name}";
|
||||
};
|
||||
};
|
||||
}));
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
default = { };
|
||||
example = {
|
||||
|
@ -41,11 +48,16 @@
|
|||
};
|
||||
};
|
||||
|
||||
backups = with lib; mkOption {
|
||||
backups =
|
||||
with lib;
|
||||
mkOption {
|
||||
description = ''
|
||||
Periodic backups to create with Restic.
|
||||
'';
|
||||
type = types.attrsOf (types.submodule ({ name, ... }: {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
paths = mkOption {
|
||||
# This is nullable for legacy reasons only. We should consider making it a pure listOf
|
||||
|
@ -112,9 +124,7 @@
|
|||
description = ''
|
||||
Extra arguments passed to restic backup.
|
||||
'';
|
||||
example = [
|
||||
"--exclude-file=/etc/nixos/restic-ignore"
|
||||
];
|
||||
example = [ "--exclude-file=/etc/nixos/restic-ignore" ];
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
|
@ -123,9 +133,7 @@
|
|||
description = ''
|
||||
Extra extended options to be passed to the restic --option flag.
|
||||
'';
|
||||
example = [
|
||||
"sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'"
|
||||
];
|
||||
example = [ "sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'" ];
|
||||
};
|
||||
|
||||
initialize = mkOption {
|
||||
|
@ -167,9 +175,7 @@
|
|||
description = ''
|
||||
A list of options for 'restic check'.
|
||||
'';
|
||||
example = [
|
||||
"--with-cache"
|
||||
];
|
||||
example = [ "--with-cache" ];
|
||||
};
|
||||
|
||||
dynamicFilesFrom = mkOption {
|
||||
|
@ -211,7 +217,9 @@
|
|||
'';
|
||||
};
|
||||
};
|
||||
}));
|
||||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
example = {
|
||||
localbackup = {
|
||||
|
@ -234,20 +242,22 @@
|
|||
};
|
||||
|
||||
config = {
|
||||
services.restic.backups = let
|
||||
services.restic.backups =
|
||||
let
|
||||
stores = config.pub-solar-os.backups.stores;
|
||||
backups = config.pub-solar-os.backups.backups;
|
||||
|
||||
storeNames = builtins.attrNames stores;
|
||||
backupNames = builtins.attrNames backups;
|
||||
|
||||
createBackups = backupName: map
|
||||
(storeName: {
|
||||
createBackups =
|
||||
backupName:
|
||||
map (storeName: {
|
||||
name = "${backupName}-${storeName}";
|
||||
value = stores."${storeName}" // backups."${backupName}";
|
||||
})
|
||||
storeNames;
|
||||
}) storeNames;
|
||||
|
||||
in builtins.listToAttrs (lib.lists.flatten (map createBackups backupNames));
|
||||
in
|
||||
builtins.listToAttrs (lib.lists.flatten (map createBackups backupNames));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.config = lib.mkDefault {
|
||||
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ];
|
||||
};
|
||||
nixpkgs.config = lib.mkDefault { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ]; };
|
||||
|
||||
nix = {
|
||||
# Use default version alias for nix package
|
||||
|
|
|
@ -42,9 +42,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
nixpkgs.config = lib.mkDefault {
|
||||
permittedInsecurePackages = [ "keycloak-23.0.6" ];
|
||||
};
|
||||
nixpkgs.config = lib.mkDefault { permittedInsecurePackages = [ "keycloak-23.0.6" ]; };
|
||||
|
||||
# keycloak
|
||||
services.keycloak = {
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
}:
|
||||
let
|
||||
in
|
||||
{
|
||||
name = "keycloak";
|
||||
|
||||
hostPkgs = pkgs;
|
||||
|
@ -42,9 +44,7 @@ in {
|
|||
./support/global.nix
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"f /tmp/dbf 1777 root root 10d password"
|
||||
];
|
||||
systemd.tmpfiles.rules = [ "f /tmp/dbf 1777 root root 10d password" ];
|
||||
|
||||
virtualisation.memorySize = 4096;
|
||||
|
||||
|
@ -65,7 +65,9 @@ in {
|
|||
|
||||
enableOCR = true;
|
||||
|
||||
testScript = {nodes, ...}: let
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
user = nodes.client.users.users.${nodes.client.pub-solar-os.authentication.username};
|
||||
#uid = toString user.uid;
|
||||
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u ${user.name})/bus";
|
||||
|
@ -73,7 +75,8 @@ in {
|
|||
su = command: "su - ${user.name} -c '${command}'";
|
||||
gseval = "call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval";
|
||||
wmClass = su "${gdbus} ${gseval} global.display.focus_window.wm_class";
|
||||
in ''
|
||||
in
|
||||
''
|
||||
start_all()
|
||||
|
||||
nachtigall.wait_for_unit("system.slice")
|
||||
|
|
|
@ -3,14 +3,11 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./global.nix
|
||||
];
|
||||
}:
|
||||
{
|
||||
imports = [ ./global.nix ];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"f /tmp/step-ca-intermediate-pw 1777 root root 10d password"
|
||||
];
|
||||
systemd.tmpfiles.rules = [ "f /tmp/step-ca-intermediate-pw 1777 root root 10d password" ];
|
||||
|
||||
networking.interfaces.eth0.ipv4.addresses = [
|
||||
{
|
||||
|
@ -19,7 +16,8 @@
|
|||
}
|
||||
];
|
||||
|
||||
services.step-ca = let
|
||||
services.step-ca =
|
||||
let
|
||||
certificates = pkgs.stdenv.mkDerivation {
|
||||
name = "certificates";
|
||||
src = ./step;
|
||||
|
@ -29,7 +27,8 @@
|
|||
cp -r secrets $out/
|
||||
'';
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
intermediatePasswordFile = "/tmp/step-ca-intermediate-pw";
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./global.nix
|
||||
];
|
||||
imports = [ ./global.nix ];
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
pub-solar-os.networking.domain = "test.pub.solar";
|
||||
|
||||
security.acme.defaults.server = "https://ca.${config.pub-solar-os.networking.domain}/acme/acme/directory";
|
||||
|
||||
security.pki.certificates = [
|
||||
(builtins.readFile ./step/certs/root_ca.crt)
|
||||
];
|
||||
security.pki.certificates = [ (builtins.readFile ./step/certs/root_ca.crt) ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
|
@ -24,10 +23,12 @@
|
|||
|
||||
security.pam.services.sshd.allowNullPassword = true;
|
||||
|
||||
virtualisation.forwardPorts = let
|
||||
virtualisation.forwardPorts =
|
||||
let
|
||||
address = (builtins.elemAt config.networking.interfaces.eth0.ipv4.addresses 0).address;
|
||||
lastAddressPart = builtins.elemAt (lib.strings.splitString "." address) 3;
|
||||
in [
|
||||
in
|
||||
[
|
||||
{
|
||||
from = "host";
|
||||
host.port = 2000 + (lib.strings.toInt lastAddressPart);
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
"federatedRoots": null,
|
||||
"address": ":443",
|
||||
"insecureAddress": "",
|
||||
"dnsNames": [
|
||||
"ca.test.pub.solar"
|
||||
],
|
||||
"dnsNames": ["ca.test.pub.solar"],
|
||||
"logger": {
|
||||
"format": "text"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue