diff options
Diffstat (limited to '')
-rw-r--r-- | modules/system/services/adb/default.nix (renamed from sys/svcs/adb/default.nix) | 0 | ||||
-rw-r--r-- | modules/system/services/backup/default.nix (renamed from sys/svcs/backup/default.nix) | 11 | ||||
-rw-r--r-- | modules/system/services/dconf/default.nix | 7 | ||||
-rw-r--r-- | modules/system/services/default.nix (renamed from sys/svcs/default.nix) | 4 | ||||
-rw-r--r-- | modules/system/services/fwupd/default.nix | 14 | ||||
-rw-r--r-- | modules/system/services/issue_file/default.nix (renamed from sys/svcs/getty/default.nix) | 13 | ||||
-rw-r--r-- | modules/system/services/nix/default.nix (renamed from sys/svcs/nix/default.nix) | 1 | ||||
-rw-r--r-- | modules/system/services/openssh/default.nix (renamed from sys/svcs/openssh/default.nix) | 0 | ||||
-rw-r--r-- | modules/system/services/postgresql/default.nix | 17 | ||||
-rw-r--r-- | modules/system/services/printing/default.nix | 45 | ||||
-rw-r--r-- | modules/system/services/scanning/default.nix | 25 | ||||
-rw-r--r-- | modules/system/services/serverphone/certificates/ca.crt (renamed from sys/svcs/serverphone/certificates/ca.crt) | 0 | ||||
-rw-r--r-- | modules/system/services/serverphone/certificates/server.crt (renamed from sys/svcs/serverphone/certificates/server.crt) | 0 | ||||
-rw-r--r-- | modules/system/services/serverphone/default.nix (renamed from sys/svcs/serverphone/default.nix) | 0 | ||||
l--------- | modules/system/services/serverphone/keys/key_1 (renamed from sys/svcs/serverphone/keys/key_1) | 0 | ||||
l--------- | modules/system/services/serverphone/keys/key_2 (renamed from sys/svcs/serverphone/keys/key_2) | 0 | ||||
-rw-r--r-- | modules/system/services/snapper/default.nix | 53 | ||||
-rw-r--r-- | modules/system/services/steam/default.nix (renamed from sys/svcs/steam/default.nix) | 8 | ||||
-rw-r--r-- | modules/system/services/swaylock/default.nix (renamed from sys/svcs/swaylock/default.nix) | 0 | ||||
-rw-r--r-- | modules/system/services/xdg/default.nix (renamed from sys/svcs/xdg/default.nix) | 0 | ||||
-rwxr-xr-x | modules/system/services/xdg/scripts/lf_wrapper.sh (renamed from sys/svcs/xdg/scripts/lf_wrapper.sh) | 0 | ||||
-rwxr-xr-x | modules/system/services/xdg/scripts/ranger_wrapper.sh (renamed from sys/svcs/xdg/scripts/ranger_wrapper.sh) | 0 |
22 files changed, 180 insertions, 18 deletions
diff --git a/sys/svcs/adb/default.nix b/modules/system/services/adb/default.nix index 4055dbb1..4055dbb1 100644 --- a/sys/svcs/adb/default.nix +++ b/modules/system/services/adb/default.nix diff --git a/sys/svcs/backup/default.nix b/modules/system/services/backup/default.nix index 91433bf9..705dcf23 100644 --- a/sys/svcs/backup/default.nix +++ b/modules/system/services/backup/default.nix @@ -9,16 +9,18 @@ ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; ''; - cfg = config.soispha.fs.backup; + + cfg = config.soispha.backup; in { - options.soispha.fs.backup = { - enable = lib.mkEnableOption (lib.mdDoc "backups with snap-sync"); + options.soispha.backup = { + enable = lib.mkEnableOption "backups with my forked snap-sync"; backupDiskUuid = lib.mkOption { type = lib.types.str; example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; - description = lib.mdDoc "The UUID of the backup disk"; + description = "The UUID of the backup disk"; }; }; + config = lib.mkIf cfg.enable { systemd = { services.backup = { @@ -31,6 +33,7 @@ in { ExecStart = "${backup-script}/bin/backsnap"; }; }; + timers.backup = { wantedBy = ["timers.target"]; unitConfig = { diff --git a/modules/system/services/dconf/default.nix b/modules/system/services/dconf/default.nix new file mode 100644 index 00000000..f6598a9b --- /dev/null +++ b/modules/system/services/dconf/default.nix @@ -0,0 +1,7 @@ +{...}: { + # needed to make home-manager play nice with some apps. See: + # https://nix-community.github.io/home-manager/index.xhtml#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal + programs.dconf.enable = true; + # FIXME: This should also be parameterized. <2024-05-16> +} +# vim: nolinebreak nowrap textwidth=0 diff --git a/sys/svcs/default.nix b/modules/system/services/default.nix index 56a16055..76ef26e2 100644 --- a/sys/svcs/default.nix +++ b/modules/system/services/default.nix @@ -1,16 +1,16 @@ {...}: { imports = [ + #./serverphone ./adb ./backup ./dconf ./fwupd - ./getty + ./issue_file ./nix ./openssh ./postgresql ./printing ./scanning - #./serverphone ./snapper ./steam ./swaylock diff --git a/modules/system/services/fwupd/default.nix b/modules/system/services/fwupd/default.nix new file mode 100644 index 00000000..5ad4f467 --- /dev/null +++ b/modules/system/services/fwupd/default.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.services.fwupd; +in { + options.soispha.services.fwupd = { + enable = lib.mkEnableOption "fwupd"; + }; + config = lib.mkIf cfg.enable { + services.fwupd.enable = true; + }; +} diff --git a/sys/svcs/getty/default.nix b/modules/system/services/issue_file/default.nix index 7e8a4e46..930be1d9 100644 --- a/sys/svcs/getty/default.nix +++ b/modules/system/services/issue_file/default.nix @@ -1,10 +1,7 @@ -{ - lib, - config, - ... -}: { - services.getty = { - greetingLine = lib.mkForce '' +{config, ...}: { + environment.etc.issue = { + # Friendly greeting on the virtual consoles. + text = '' [?25l[?7l[38;2;255;77;77m [39m[49m [38;2;255;77;77m ▗▄▄▄ ▗▄▄▄▄ ▄▄▄▖ [39m[49m [38;2;255;77;77m ▜███▙ ▜███▙ ▟███▛ [39m[49m @@ -27,7 +24,7 @@ [38;2;233;77;255m ▟███▛ ▜███▙ ▜███▙ [39m[49m [38;2;233;77;255m ▝▀▀▀ ▀▀▀▀▘ ▀▀▀▘ [39m[49m [38;2;233;77;255m [39m[49m[0m - [17A[9999999D[46C[34m[1m NixOS ${config.system.nixos.label} [0m + [17A[9999999D[46C[34m[1m NixOS ${config.system.nixos.label} [0m [46C[0m --------------[0m [46C [46C [34m[1m date: [0m\d diff --git a/sys/svcs/nix/default.nix b/modules/system/services/nix/default.nix index 5766fcdd..65fc7273 100644 --- a/sys/svcs/nix/default.nix +++ b/modules/system/services/nix/default.nix @@ -1,5 +1,6 @@ { pkgs, + # flakes nixpkgs_as_input, templates, diff --git a/sys/svcs/openssh/default.nix b/modules/system/services/openssh/default.nix index b733dbe7..b733dbe7 100644 --- a/sys/svcs/openssh/default.nix +++ b/modules/system/services/openssh/default.nix diff --git a/modules/system/services/postgresql/default.nix b/modules/system/services/postgresql/default.nix new file mode 100644 index 00000000..c47a235c --- /dev/null +++ b/modules/system/services/postgresql/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.services.postgresql; +in { + options.soispha.services.postgresql = { + enable = lib.mkEnableOption "postgresql"; + }; + + config = lib.mkIf cfg.enable { + services.postgresql = { + enable = true; + }; + }; +} diff --git a/modules/system/services/printing/default.nix b/modules/system/services/printing/default.nix new file mode 100644 index 00000000..85d15b16 --- /dev/null +++ b/modules/system/services/printing/default.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.services.printing; +in { + options.soispha.services.printing = { + enable = lib.mkEnableOption "default printing configuration"; + }; + + config = lib.mkIf cfg.enable { + services.avahi = { + enable = true; + nssmdns4 = true; + nssmdns6 = true; + openFirewall = true; + }; + + services.printing = { + enable = true; + startWhenNeeded = true; + webInterface = true; + + # deletes `/var/cache/cups`, `/var/lib/cups` and `/var/spool/cups` on cups startup + stateless = true; + + drivers = []; + }; + + hardware = { + printers = { + ensurePrinters = [ + { + name = "Brother"; + description = "Brother DCP-9022CDW"; + model = "everywhere"; + deviceUri = "dnssd://Brother%20DCP-9022CDW._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-30055c773bcf"; + } + ]; + ensureDefaultPrinter = "Brother"; + }; + }; + }; +} diff --git a/modules/system/services/scanning/default.nix b/modules/system/services/scanning/default.nix new file mode 100644 index 00000000..dda507fa --- /dev/null +++ b/modules/system/services/scanning/default.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.scanning; +in { + options.soispha.services.scanning = { + enable = lib.mkEnableOption "default scanning configuration"; + }; + + config = lib.mkIf cfg.enable { + hardware = { + sane = { + enable = true; + extraBackends = [pkgs.sane-airscan]; + }; + }; + + users.users.soispha.extraGroups = [ + "scanner" # for permission to access the scanner. + ]; + }; +} diff --git a/sys/svcs/serverphone/certificates/ca.crt b/modules/system/services/serverphone/certificates/ca.crt index 7a4ae6f9..7a4ae6f9 100644 --- a/sys/svcs/serverphone/certificates/ca.crt +++ b/modules/system/services/serverphone/certificates/ca.crt diff --git a/sys/svcs/serverphone/certificates/server.crt b/modules/system/services/serverphone/certificates/server.crt index f994cdc8..f994cdc8 100644 --- a/sys/svcs/serverphone/certificates/server.crt +++ b/modules/system/services/serverphone/certificates/server.crt diff --git a/sys/svcs/serverphone/default.nix b/modules/system/services/serverphone/default.nix index 20125a75..20125a75 100644 --- a/sys/svcs/serverphone/default.nix +++ b/modules/system/services/serverphone/default.nix diff --git a/sys/svcs/serverphone/keys/key_1 b/modules/system/services/serverphone/keys/key_1 index 67720882..67720882 120000 --- a/sys/svcs/serverphone/keys/key_1 +++ b/modules/system/services/serverphone/keys/key_1 diff --git a/sys/svcs/serverphone/keys/key_2 b/modules/system/services/serverphone/keys/key_2 index 24df7207..24df7207 120000 --- a/sys/svcs/serverphone/keys/key_2 +++ b/modules/system/services/serverphone/keys/key_2 diff --git a/modules/system/services/snapper/default.nix b/modules/system/services/snapper/default.nix new file mode 100644 index 00000000..bf8201a4 --- /dev/null +++ b/modules/system/services/snapper/default.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.services.snapper; +in { + options.soispha.services.snapper = { + enable = lib.mkEnableOption "snapper config"; + }; + + config = lib.mkIf cfg.enable { + services.snapper = { + configs = { + srv = { + SUBVOLUME = "/srv"; + FSTYPE = "btrfs"; + # users and groups allowed to work with config + ALLOW_GROUPS = ["wheel"]; + + # sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots + # directory + SYNC_ACL = true; + + # run daily number cleanup + NUMBER_CLEANUP = false; + + # limit for number cleanup + NUMBER_MIN_AGE = 1800; + NUMBER_LIMIT = 50; + NUMBER_LIMIT_IMPORTANT = 10; + + # create hourly snapshots + TIMELINE_CREATE = true; + + # cleanup hourly snapshots after some time + TIMELINE_CLEANUP = true; + + # limits for timeline cleanup + TIMELINE_MIN_AGE = 1800; + TIMELINE_LIMIT_HOURLY = 7; + TIMELINE_LIMIT_DAILY = 3; + TIMELINE_LIMIT_WEEKLY = 2; + TIMELINE_LIMIT_MONTHLY = 0; + TIMELINE_LIMIT_YEARLY = 2; + + # cleanup empty pre-post-pairs + EMPTY_PRE_POST_CLEANUP = true; + }; + }; + }; + }; +} diff --git a/sys/svcs/steam/default.nix b/modules/system/services/steam/default.nix index 54091493..6e507fd9 100644 --- a/sys/svcs/steam/default.nix +++ b/modules/system/services/steam/default.nix @@ -7,16 +7,16 @@ cfg = config.soispha.services.steam; in { options.soispha.services.steam = { - enable = lib.mkOption { - default = false; - description = lib.mdDoc "Steam"; - }; + enable = lib.mkEnableOption "Stream"; }; + config = lib.mkIf cfg.enable { programs.steam = { enable = true; }; + environment.systemPackages = [ + # TODO: Why is this package needed? <2024-05-16> pkgs.wineWowPackages.waylandFull ]; }; diff --git a/sys/svcs/swaylock/default.nix b/modules/system/services/swaylock/default.nix index 6cbcef28..6cbcef28 100644 --- a/sys/svcs/swaylock/default.nix +++ b/modules/system/services/swaylock/default.nix diff --git a/sys/svcs/xdg/default.nix b/modules/system/services/xdg/default.nix index 5140a832..5140a832 100644 --- a/sys/svcs/xdg/default.nix +++ b/modules/system/services/xdg/default.nix diff --git a/sys/svcs/xdg/scripts/lf_wrapper.sh b/modules/system/services/xdg/scripts/lf_wrapper.sh index 16603fe4..16603fe4 100755 --- a/sys/svcs/xdg/scripts/lf_wrapper.sh +++ b/modules/system/services/xdg/scripts/lf_wrapper.sh diff --git a/sys/svcs/xdg/scripts/ranger_wrapper.sh b/modules/system/services/xdg/scripts/ranger_wrapper.sh index e148bf19..e148bf19 100755 --- a/sys/svcs/xdg/scripts/ranger_wrapper.sh +++ b/modules/system/services/xdg/scripts/ranger_wrapper.sh |