diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.just/machine.just b/.just/machine.just index 098e101..cc7665e 100644 --- a/.just/machine.just +++ b/.just/machine.just @@ -1,11 +1,11 @@ -@_default: list - -[doc('List machines')] -@list: - ls -1 ../systems/x86_64-linux/ - -[doc('Update the target machine')] -[no-exit-message] -@update machine: - just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | sed ':a;N;$!ba;s/\n/, /g')" - nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }} +@_default: list + +[doc('List machines')] +@list: + ls -1 ../systems/x86_64-linux/ + +[doc('Update the target machine')] +[no-exit-message] +@update machine: + just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | sed ':a;N;$!ba;s/\n/, /g')" + nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }} diff --git a/.just/vars.just b/.just/vars.just index 0d381ef..d8bd181 100644 --- a/.just/vars.just +++ b/.just/vars.just @@ -1,36 +1,36 @@ -set unstable - -base_path := invocation_directory() / "systems/x86_64-linux" -# sops := "nix shell nixpkgs#sops --command sops" -# yq := "nix shell nixpkgs#yq --command yq" -sops := "sops" -yq := "yq" - -@_default: - just --list - -[doc('list all vars of the target machine')] -list machine: - sops decrypt {{ base_path }}/{{ machine }}/secrets.yml - -@edit machine: - sops edit {{ base_path }}/{{ machine }}/secrets.yml - -@set machine key value: - sops set {{ base_path }}/{{ machine }}/secrets.yml "$(printf '%s\n' '["{{ key }}"]' | sed -E 's#/#"]["#g; s/\["([0-9]+)"\]/[\1]/g')" "\"$(echo '{{ value }}' | sed 's/\"/\\\"/g')\"" - - git add {{ base_path }}/{{ machine }}/secrets.yml - git commit -m 'chore(secrets): set secret "{{ key }}" for machine "{{ machine}}"' -- {{ base_path }}/{{ machine }}/secrets.yml > /dev/null - - echo "Done" - -@get machine key: - sops decrypt {{ base_path }}/{{ machine }}/secrets.yml | yq ".$(echo "{{ key }}" | sed -E 's/\//./g')" - -@remove machine key: - sops unset {{ base_path }}/{{ machine }}/secrets.yml "$(printf '%s\n' '["{{ key }}"]' | sed -E 's#/#"]["#g; s/\["([0-9]+)"\]/[\1]/g')" - - git add {{ base_path }}/{{ machine }}/secrets.yml - git commit -m 'chore(secrets): removed secret "{{ key }}" from machine "{{ machine}}"' -- {{ base_path }}/{{ machine }}/secrets.yml > /dev/null - +set unstable + +base_path := invocation_directory() / "systems/x86_64-linux" +# sops := "nix shell nixpkgs#sops --command sops" +# yq := "nix shell nixpkgs#yq --command yq" +sops := "sops" +yq := "yq" + +@_default: + just --list + +[doc('list all vars of the target machine')] +list machine: + sops decrypt {{ base_path }}/{{ machine }}/secrets.yml + +@edit machine: + sops edit {{ base_path }}/{{ machine }}/secrets.yml + +@set machine key value: + sops set {{ base_path }}/{{ machine }}/secrets.yml "$(printf '%s\n' '["{{ key }}"]' | sed -E 's#/#"]["#g; s/\["([0-9]+)"\]/[\1]/g')" "\"$(echo '{{ value }}' | sed 's/\"/\\\"/g')\"" + + git add {{ base_path }}/{{ machine }}/secrets.yml + git commit -m 'chore(secrets): set secret "{{ key }}" for machine "{{ machine}}"' -- {{ base_path }}/{{ machine }}/secrets.yml > /dev/null + + echo "Done" + +@get machine key: + sops decrypt {{ base_path }}/{{ machine }}/secrets.yml | yq ".$(echo "{{ key }}" | sed -E 's/\//./g')" + +@remove machine key: + sops unset {{ base_path }}/{{ machine }}/secrets.yml "$(printf '%s\n' '["{{ key }}"]' | sed -E 's#/#"]["#g; s/\["([0-9]+)"\]/[\1]/g')" + + git add {{ base_path }}/{{ machine }}/secrets.yml + git commit -m 'chore(secrets): removed secret "{{ key }}" from machine "{{ machine}}"' -- {{ base_path }}/{{ machine }}/secrets.yml > /dev/null + echo "Done" \ No newline at end of file diff --git a/.justfile b/.justfile index 87563d0..3a15d20 100644 --- a/.justfile +++ b/.justfile @@ -1,33 +1,33 @@ -@_default: - just --list --list-submodules - -[doc('Manage vars')] -mod vars '.just/vars.just' - -[doc('Manage machines')] -mod machine '.just/machine.just' - -[doc('Show information about project')] -@show: - echo "show" - -[doc('update the flake dependencies')] -@update: - nix flake update - git commit -m 'chore: update dependencies' -- ./flake.lock > /dev/null - echo "Done" - -[doc('Introspection on flake output')] -@select key: - nix eval --json .#{{ key }} | jq . - - - -#=============================================================================================== -# Utils -#=============================================================================================== -[no-exit-message] -[no-cd] -[private] -@assert condition message: +@_default: + just --list --list-submodules + +[doc('Manage vars')] +mod vars '.just/vars.just' + +[doc('Manage machines')] +mod machine '.just/machine.just' + +[doc('Show information about project')] +@show: + echo "show" + +[doc('update the flake dependencies')] +@update: + nix flake update + git commit -m 'chore: update dependencies' -- ./flake.lock > /dev/null + echo "Done" + +[doc('Introspection on flake output')] +@select key: + nix eval --json .#{{ key }} | jq . + + + +#=============================================================================================== +# Utils +#=============================================================================================== +[no-exit-message] +[no-cd] +[private] +@assert condition message: [ {{ condition }} ] || { echo -e 1>&2 "\n\x1b[1;41m Error \x1b[0m {{ message }}\n"; exit 1; } \ No newline at end of file diff --git a/flake.lock b/flake.lock index 4f55a24..5fda659 100644 --- a/flake.lock +++ b/flake.lock @@ -320,6 +320,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "mydia", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nvf", @@ -340,7 +361,7 @@ "type": "github" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -361,7 +382,7 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_5": { "inputs": { "nixpkgs-lib": [ "terranix", @@ -402,7 +423,7 @@ }, "flake-utils-plus": { "inputs": { - "flake-utils": "flake-utils_5" + "flake-utils": "flake-utils_4" }, "locked": { "lastModified": 1715533576, @@ -457,25 +478,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "inputs": { - "systems": "systems_7" + "systems": "systems_6" }, "locked": { "lastModified": 1694529238, @@ -682,19 +685,19 @@ }, "mydia": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1764568388, - "narHash": "sha256-kl8165eI0lUz9E96sdreZ48/nApydDfJP8IksjBveAw=", - "owner": "getmydia", + "lastModified": 1764661298, + "narHash": "sha256-sdYGCZnrbjshBDvGDI34MepTHAJsdL3FZQHdqRJzPSk=", + "owner": "chris-kruining", "repo": "mydia", - "rev": "74f0cf9a8ca782581ec0a35acf6526fccfbb6e2a", + "rev": "a5a03289332c435946c4ebdcaee70d96380bc1a7", "type": "github" }, "original": { - "owner": "getmydia", + "owner": "chris-kruining", "repo": "mydia", "type": "github" } @@ -745,7 +748,7 @@ "nix-minecraft": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "nixpkgs": "nixpkgs_6" }, "locked": { @@ -1065,10 +1068,10 @@ "nvf": { "inputs": { "flake-compat": "flake-compat_4", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "mnw": "mnw", "nixpkgs": "nixpkgs_8", - "systems": "systems_6" + "systems": "systems_5" }, "locked": { "lastModified": 1762622004, @@ -1239,11 +1242,11 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "gnome-shell": "gnome-shell", "nixpkgs": "nixpkgs_10", "nur": "nur", - "systems": "systems_8", + "systems": "systems_7", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1384,28 +1387,13 @@ "type": "github" } }, - "systems_9": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "terranix": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_5", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_9" + "systems": "systems_8" }, "locked": { "lastModified": 1762472226, diff --git a/flake.nix b/flake.nix index 5668380..7ccab59 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,8 @@ }; mydia = { - url = "github:getmydia/mydia"; + url = "github:chris-kruining/mydia"; + # url = "github:getmydia/mydia"; }; }; diff --git a/homes/x86_64-linux/chris@mandos/default.nix b/homes/x86_64-linux/chris@mandos/default.nix index 6989314..ba87e73 100644 --- a/homes/x86_64-linux/chris@mandos/default.nix +++ b/homes/x86_64-linux/chris@mandos/default.nix @@ -1,10 +1,11 @@ -{ osConfig, ... }: -{ +{osConfig, ...}: { home.stateVersion = osConfig.system.stateVersion; programs.git = { - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; + settings.user = { + name = "Chris Kruining"; + email = "chris@kruining.eu"; + }; }; sneeuwvlok = { diff --git a/homes/x86_64-linux/chris@manwe/default.nix b/homes/x86_64-linux/chris@manwe/default.nix index 9abe613..0aced9b 100644 --- a/homes/x86_64-linux/chris@manwe/default.nix +++ b/homes/x86_64-linux/chris@manwe/default.nix @@ -1,10 +1,11 @@ -{ osConfig, ... }: -{ +{osConfig, ...}: { home.stateVersion = osConfig.system.stateVersion; programs.git = { - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; + settings.user = { + name = "Chris Kruining"; + email = "chris@kruining.eu"; + }; }; sneeuwvlok = { diff --git a/homes/x86_64-linux/chris@orome/default.nix b/homes/x86_64-linux/chris@orome/default.nix index dece506..7a1dc43 100644 --- a/homes/x86_64-linux/chris@orome/default.nix +++ b/homes/x86_64-linux/chris@orome/default.nix @@ -1,10 +1,11 @@ -{ osConfig, ... }: -{ +{osConfig, ...}: { home.stateVersion = osConfig.system.stateVersion; programs.git = { - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; + settings.user = { + name = "Chris Kruining"; + email = "chris@kruining.eu"; + }; }; sneeuwvlok = { diff --git a/homes/x86_64-linux/chris@tulkas/default.nix b/homes/x86_64-linux/chris@tulkas/default.nix index 6989314..ba87e73 100644 --- a/homes/x86_64-linux/chris@tulkas/default.nix +++ b/homes/x86_64-linux/chris@tulkas/default.nix @@ -1,10 +1,11 @@ -{ osConfig, ... }: -{ +{osConfig, ...}: { home.stateVersion = osConfig.system.stateVersion; programs.git = { - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; + settings.user = { + name = "Chris Kruining"; + email = "chris@kruining.eu"; + }; }; sneeuwvlok = { diff --git a/modules/home/application/onlyoffice/default.nix b/modules/home/application/onlyoffice/default.nix index 8153b68..0479539 100644 --- a/modules/home/application/onlyoffice/default.nix +++ b/modules/home/application/onlyoffice/default.nix @@ -1,16 +1,20 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; cfg = config.${namespace}.application.onlyoffice; -in -{ +in { options.${namespace}.application.onlyoffice = { enable = mkEnableOption "enable onlyoffice"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ onlyoffice-bin ]; - # fonts.packages = with pkgs; [ corefonts ]; + home.packages = with pkgs; [onlyoffice-desktopeditors]; }; } diff --git a/modules/home/application/steam/default.nix b/modules/home/application/steam/default.nix index ec47942..8c87b40 100644 --- a/modules/home/application/steam/default.nix +++ b/modules/home/application/steam/default.nix @@ -1,55 +1,55 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let - inherit (lib) mkIf mkEnableOption; - - cfg = config.${namespace}.application.steam; -in -{ - options.${namespace}.application.steam = { - enable = mkEnableOption "enable steam"; - }; - - config = mkIf cfg.enable { - home.packages = with pkgs; [ protonup-ng ]; - - home.sessionVariables = { - STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; - }; - - programs = { - # steam = { - # enable = true; - # package = pkgs.steam-small.override { - # extraEnv = { - # DXVK_HUD = "compiler"; - # MANGOHUD = true; - # }; - # }; - - # gamescopeSession = { - # enable = true; - # args = ["--immediate-flips"]; - # }; - # }; - - # https://github.com/FeralInteractive/gamemode - # gamemode = { - # enable = true; - # enableRenice = true; - # settings = {}; - # }; - - # gamescope = { - # enable = true; - # capSysNice = true; - # env = { - # DXVK_HDR = "1"; - # ENABLE_GAMESCOPE_WSI = "1"; - # WINE_FULLSCREEN_FSR = "1"; - # WLR_RENDERER = "vulkan"; - # }; - # args = ["--hdr-enabled"]; - # }; - }; - }; -} +{ inputs, config, lib, pkgs, namespace, ... }: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.application.steam; +in +{ + options.${namespace}.application.steam = { + enable = mkEnableOption "enable steam"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ protonup-ng ]; + + home.sessionVariables = { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; + }; + + programs = { + # steam = { + # enable = true; + # package = pkgs.steam-small.override { + # extraEnv = { + # DXVK_HUD = "compiler"; + # MANGOHUD = true; + # }; + # }; + + # gamescopeSession = { + # enable = true; + # args = ["--immediate-flips"]; + # }; + # }; + + # https://github.com/FeralInteractive/gamemode + # gamemode = { + # enable = true; + # enableRenice = true; + # settings = {}; + # }; + + # gamescope = { + # enable = true; + # capSysNice = true; + # env = { + # DXVK_HDR = "1"; + # ENABLE_GAMESCOPE_WSI = "1"; + # WINE_FULLSCREEN_FSR = "1"; + # WLR_RENDERER = "vulkan"; + # }; + # args = ["--hdr-enabled"]; + # }; + }; + }; +} diff --git a/modules/home/application/teamspeak/default.nix b/modules/home/application/teamspeak/default.nix index aab3c5d..d234e9a 100644 --- a/modules/home/application/teamspeak/default.nix +++ b/modules/home/application/teamspeak/default.nix @@ -1,15 +1,15 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let - inherit (lib) mkIf mkEnableOption; - - cfg = config.${namespace}.application.teamspeak; -in -{ - options.${namespace}.application.teamspeak = { - enable = mkEnableOption "enable teamspeak"; - }; - - config = mkIf cfg.enable { - home.packages = with pkgs; [ teamspeak3 teamspeak6-client ]; - }; -} +{ inputs, config, lib, pkgs, namespace, ... }: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.application.teamspeak; +in +{ + options.${namespace}.application.teamspeak = { + enable = mkEnableOption "enable teamspeak"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ teamspeak3 teamspeak6-client ]; + }; +} diff --git a/modules/home/shell/toolset/git/default.nix b/modules/home/shell/toolset/git/default.nix index 299b2a6..dd138c8 100644 --- a/modules/home/shell/toolset/git/default.nix +++ b/modules/home/shell/toolset/git/default.nix @@ -1,10 +1,14 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.${namespace}.shell.toolset.git; -in -{ +in { options.${namespace}.shell.toolset.git = { enable = mkEnableOption "version-control system"; }; @@ -12,7 +16,7 @@ in config = mkIf cfg.enable { home.sessionVariables.GITHUB_TOKEN = "$(cat /run/agenix/tokenGH)"; - home.packages = with pkgs; [ lazygit lazyjj jujutsu ]; + home.packages = with pkgs; [lazygit lazyjj jujutsu]; programs = { zsh.initContent = '' @@ -29,14 +33,6 @@ in git = { enable = true; package = pkgs.gitFull; - difftastic = { - enable = true; - options = { - background = "dark"; - color = "always"; - display = "inline"; - }; - }; ignores = [ # General: @@ -69,7 +65,7 @@ in "*.elc" ]; - extraConfig = { + settings = { init.defaultBranch = "main"; core = { editor = "nvim"; @@ -106,6 +102,16 @@ in }; }; }; + + difftastic = { + enable = true; + git.enable = true; + options = { + background = "dark"; + color = "always"; + display = "inline"; + }; + }; }; }; } diff --git a/modules/nixos/application/steam/default.nix b/modules/nixos/application/steam/default.nix index 6170e8a..735aa80 100644 --- a/modules/nixos/application/steam/default.nix +++ b/modules/nixos/application/steam/default.nix @@ -1,10 +1,15 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; cfg = config.${namespace}.application.steam; -in -{ +in { options.${namespace}.application.steam = { enable = mkEnableOption "enable steam"; }; @@ -13,7 +18,7 @@ in programs = { steam = { enable = true; - package = pkgs.steam-small.override { + package = pkgs.steam.override { extraEnv = { DXVK_HUD = "compiler"; MANGOHUD = true; diff --git a/modules/nixos/services/authentication/zitadel/default.nix b/modules/nixos/services/authentication/zitadel/default.nix index 1b400bb..c0d9dc5 100644 --- a/modules/nixos/services/authentication/zitadel/default.nix +++ b/modules/nixos/services/authentication/zitadel/default.nix @@ -560,8 +560,6 @@ in tofu = lib.getExe pkgs.opentofu; in '' - #!/usr/bin/env bash - if [ "$(systemctl is-active zitadel)" != "active" ]; then echo "Zitadel is not running" exit 1 diff --git a/modules/nixos/services/media/mydia/default.nix b/modules/nixos/services/media/mydia/default.nix index aa44856..1dbacda 100644 --- a/modules/nixos/services/media/mydia/default.nix +++ b/modules/nixos/services/media/mydia/default.nix @@ -21,12 +21,16 @@ in { config = mkIf cfg.enable { services.mydia = { enable = true; - package = inputs.mydia.packages.${system}.default; port = 2010; listenAddress = "0.0.0.0"; openFirewall = true; + database = { + type = "postgres"; + uri = "postgres://localhost:5432/mydia?sslMode=disable"; + }; + secretKeyBaseFile = config.sops.secrets."mydia/secret_key_base".path; guardianSecretKeyFile = config.sops.secrets."mydia/guardian_secret".path;