@@ -1,7 +1,11 @@
|
|||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.btrfs.autoScrub = {
|
services.btrfs.autoScrub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "weekly";
|
interval = "weekly";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
compsize
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ check_key() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_password_file() {
|
set_password_file() {
|
||||||
SOPS_AGE_KEY_FILE="$(realpath "$flake/secrets/$key/key.txt")"
|
SOPS_AGE_KEY_FILE="$flake/secrets/$key/key.txt"
|
||||||
export SOPS_AGE_KEY_FILE
|
export SOPS_AGE_KEY_FILE
|
||||||
sops --decrypt --extract "['luks']" "$flake/hosts/$host/secrets/secrets.yaml" > /tmp/installer.key
|
sops --decrypt --extract "['luks']" "$flake/hosts/$host/secrets/secrets.yaml" > /tmp/installer.key
|
||||||
unset SOPS_AGE_KEY_FILE
|
unset SOPS_AGE_KEY_FILE
|
||||||
@@ -79,7 +79,11 @@ copy_keys() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_permissions() {
|
set_permissions() {
|
||||||
chown -R "$(cat "$flake/hosts/$host/users/$user/uid"):100" "$root/persist/home/$user"
|
for path in "$flake/hosts/$host/users"/*; do
|
||||||
|
local user
|
||||||
|
user=$(basename "$path")
|
||||||
|
chown -R "$(cat "$flake/hosts/$host/users/$user/uid"):100" "$root/persist/home/$user"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
user ? throw "user argument is required",
|
|
||||||
home ? throw "home argument is required",
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
home-manager.users.${user} = {
|
|
||||||
imports = lib.lists.optional (
|
|
||||||
!config.home-manager.useGlobalPkgs
|
|
||||||
) inputs.nur.modules.homeManager.default;
|
|
||||||
};
|
|
||||||
}
|
|
@@ -43,32 +43,31 @@
|
|||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "btrfs";
|
||||||
extraArgs = [ "-f" ];
|
extraArgs = [ "-f" ];
|
||||||
subvolumes = {
|
subvolumes =
|
||||||
"@" = {
|
let
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
"@persist" = {
|
|
||||||
mountpoint = "/persist";
|
|
||||||
mountOptions = [
|
mountOptions = [
|
||||||
"compress=zstd"
|
"compress=zstd:1"
|
||||||
"noatime"
|
"noatime"
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"@" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@persist" = {
|
||||||
|
mountpoint = "/persist";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@cache" = {
|
||||||
|
mountpoint = "/cache";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"@nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"@cache" = {
|
|
||||||
mountpoint = "/cache";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -31,7 +31,6 @@ in
|
|||||||
(import ../../../common/configs/user/console/nix-cleanup { inherit user home; })
|
(import ../../../common/configs/user/console/nix-cleanup { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nixpkgs { inherit user home; })
|
|
||||||
(import ../../../common/configs/user/console/pipewire { inherit user home; })
|
(import ../../../common/configs/user/console/pipewire { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/podman { inherit user home; })
|
(import ../../../common/configs/user/console/podman { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
||||||
|
@@ -43,32 +43,31 @@
|
|||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "btrfs";
|
||||||
extraArgs = [ "-f" ];
|
extraArgs = [ "-f" ];
|
||||||
subvolumes = {
|
subvolumes =
|
||||||
"@" = {
|
let
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
"@persist" = {
|
|
||||||
mountpoint = "/persist";
|
|
||||||
mountOptions = [
|
mountOptions = [
|
||||||
"compress=zstd"
|
"compress=zstd:3"
|
||||||
"noatime"
|
"noatime"
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"@" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@persist" = {
|
||||||
|
mountpoint = "/persist";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@cache" = {
|
||||||
|
mountpoint = "/cache";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"@nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"@cache" = {
|
|
||||||
mountpoint = "/cache";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -30,7 +30,6 @@ in
|
|||||||
(import ../../../common/configs/user/console/nix-cleanup { inherit user home; })
|
(import ../../../common/configs/user/console/nix-cleanup { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nixpkgs { inherit user home; })
|
|
||||||
(import ../../../common/configs/user/console/pipewire { inherit user home; })
|
(import ../../../common/configs/user/console/pipewire { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/podman { inherit user home; })
|
(import ../../../common/configs/user/console/podman { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
||||||
|
@@ -35,32 +35,31 @@
|
|||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "btrfs";
|
||||||
extraArgs = [ "-f" ];
|
extraArgs = [ "-f" ];
|
||||||
subvolumes = {
|
subvolumes =
|
||||||
"@" = {
|
let
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
"@persist" = {
|
|
||||||
mountpoint = "/persist";
|
|
||||||
mountOptions = [
|
mountOptions = [
|
||||||
"compress=zstd"
|
"compress=zstd:5"
|
||||||
"noatime"
|
"noatime"
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"@" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@persist" = {
|
||||||
|
mountpoint = "/persist";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
|
"@cache" = {
|
||||||
|
mountpoint = "/cache";
|
||||||
|
inherit mountOptions;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"@nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"@cache" = {
|
|
||||||
mountpoint = "/cache";
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -22,7 +22,6 @@ in
|
|||||||
(import ../../../common/configs/user/console/nix { inherit user home; })
|
(import ../../../common/configs/user/console/nix { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
(import ../../../common/configs/user/console/nix-develop { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
(import ../../../common/configs/user/console/nix-direnv { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/nixpkgs { inherit user home; })
|
|
||||||
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
(import ../../../common/configs/user/console/ranger { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/sops { inherit user home; })
|
(import ../../../common/configs/user/console/sops { inherit user home; })
|
||||||
(import ../../../common/configs/user/console/ssh { inherit user home; })
|
(import ../../../common/configs/user/console/ssh { inherit user home; })
|
||||||
|
@@ -74,7 +74,7 @@ EOF
|
|||||||
cat <<'EOF' > "./hosts/$host/format.nix"
|
cat <<'EOF' > "./hosts/$host/format.nix"
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk.installer = {
|
disk.main = {
|
||||||
device = ""; # Set this to the device you want to install to
|
device = ""; # Set this to the device you want to install to
|
||||||
type = "disk";
|
type = "disk";
|
||||||
content = {
|
content = {
|
||||||
@@ -172,7 +172,6 @@ cat <<EOF > "./hosts/$host/default.nix"
|
|||||||
|
|
||||||
networking.hostName = "$host";
|
networking.hostName = "$host";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
Reference in New Issue
Block a user