diff --git a/default.nix b/default.nix index a2a64d9..8d54076 100644 --- a/default.nix +++ b/default.nix @@ -17,7 +17,7 @@ in ++ (mapModulesRec' (toString ./modules) import); environment.variables = { - KAAS = config.kaas.dir; + KAAS = config.sneeuwvlok.dir; NIXPKGS_ALLOW_UNFREE = "1"; }; diff --git a/flake.nix b/flake.nix index 9cf8e3d..b765a01 100644 --- a/flake.nix +++ b/flake.nix @@ -62,7 +62,7 @@ nixosModules = { - kaas = import ./.; + sneeuwvlok = import ./.; } // mapModulesRec ./modules import; diff --git a/modules/_home-manager/gpg.nix b/modules/_home-manager/gpg.nix deleted file mode 100644 index 598e71d..0000000 --- a/modules/_home-manager/gpg.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ home, pkgs, ... }: -{ - home.packages = with pkgs; [ - gnupg - ]; - - home.file = { - ".gnupg/gpg-agent.conf".text = '' - default-cache-ttl 34560000 - max-cache-ttl 34560000 - allow-loopback-pinentry - ''; - ".gnupg/gpg.conf".text = '' - pinentry-mode loopback - ''; - }; -} diff --git a/modules/_home-manager/terminals/default.nix b/modules/_home-manager/terminals/default.nix deleted file mode 100644 index 9ff6e8f..0000000 --- a/modules/_home-manager/terminals/default.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ pkgs, config, ... }: -{ - fonts.fontconfig.enable = true; - - home.packages = [ - (pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; }) - ]; - - home.sessionVariables._ZO_ECHO = "1"; - - programs = { - git = { - enable = true; - extraConfig = { - push = { autoSetupRemote = true; }; - credential.helper = "${ pkgs.git.override { withLibsecret = true; } }/bin/git-credential-libsecret"; - }; - }; - - zsh = { - enable = true; - autosuggestion.enable = true; - enableCompletion = true; - syntaxHighlighting.enable = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - }; - - oh-my-zsh = { - enable = true; - plugins = ["git" "docker-compose" "zoxide"]; - }; - - plugins = [ - { - name = "zsh-autosuggestion"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-autosuggestions"; - rev = "v0.7.0"; - sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98"; - }; - } - { - name = "zsh-completions"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-completions"; - rev = "0.34.0"; - sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9"; - }; - } - { - name = "zsh-syntax-highlighting"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-syntax-highlighting"; - rev = "0.7.0"; - sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r"; - }; - } - ]; - }; - - bat.enable = true; - zoxide.enable = true; - fzf.enable = true; - eza = { - enable = true; - enableZshIntegration = true; - }; - - starship = { - enable = true; - enableZshIntegration = true; - settings = { - add_newline = true; - format = "$username$hostname$nix_shell$git_branch$git_commit$git_state$git_status$directory$jobs$cmd_duration$character"; - - username = { - style_user = "blue bold"; - style_root = "red bold"; - format = "[$user]($style) "; - disabled = false; - show_always = true; - }; - - hostname = { - ssh_only = false; - ssh_symbol = "🌐 "; - format = "on [$hostname](bold red) "; - trim_at = ".local"; - disabled = false; - }; - - nix_shell = { - symbol = " "; - format = "[$symbol$name]($style) "; - style = "bright-purple bold"; - }; - - git_branch = { - only_attached = true; - format = "[$symbol$branch]($style) "; - symbol = "שׂ"; - style = "bright-yellow bold"; - }; - - git_commit = { - only_detached = true; - format = "[ﰖ$hash]($style) "; - style = "bright-yellow bold"; - }; - - git_state = { - style = "bright-purple bold"; - }; - - git_status = { - style = "bright-green bold"; - }; - - directory = { - read_only = " "; - truncation_length = 0; - }; - - cmd_duration = { - format = "[$duration]($style) "; - style = "bright-blue"; - }; - - jobs = { - style = "bright-green bold"; - }; - - character = { - success_symbol = "[\\$](bright-green bold)"; - error_symbol = "[\\$](bright-red bold)"; - }; - }; - }; - - }; -} - diff --git a/modules/_programs/communication.nix b/modules/_programs/communication.nix deleted file mode 100644 index 7b8bc30..0000000 --- a/modules/_programs/communication.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, config, ... }: -let - inherit (lib.modules) mkIf; -in -{ - options.modules.programs.communication = let - inherit (lib.options) mkEnableOption; - in { - enable = mkEnableOption "Discord and Teamspeak"; - }; - - environment.systemPackages = with pkgs; [ - webcord - teamspeak_client - ]; -} diff --git a/modules/common/qbittorrent.nix b/modules/common/qbittorrent.nix index 52785c3..45cc2dc 100644 --- a/modules/common/qbittorrent.nix +++ b/modules/common/qbittorrent.nix @@ -67,8 +67,6 @@ in }; systemd.services.qbittorrent = { - # based on the plex.nix service module and - # https://github.com/qbittorrent/qBittorrent/blob/master/dist/unix/systemd/qbittorrent-nox%40.service.in description = "qBittorrent-nox service"; documentation = [ "man:qbittorrent-nox(1)" ]; after = [ "network.target" ]; @@ -79,8 +77,6 @@ in User = cfg.user; Group = cfg.group; - # Run the pre-start script with full permissions (the "!" prefix) so it - # can create the data directory if necessary. ExecStartPre = let preStartScript = pkgs.writeScript "qbittorrent-run-prestart" '' #!${pkgs.bash}/bin/bash @@ -94,18 +90,12 @@ in in "!${preStartScript}"; - #ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox"; ExecStart = "${cfg.package}/bin/qbittorrent-nox"; - # To prevent "Quit & shutdown daemon" from working; we want systemd to - # manage it! - #Restart = "on-success"; - #UMask = "0002"; - #LimitNOFILE = cfg.openFilesLimit; }; environment = { - QBT_PROFILE=cfg.dataDir; - QBT_WEBUI_PORT=toString cfg.port; + QBT_PROFILE = cfg.dataDir; + QBT_WEBUI_PORT = toString cfg.port; }; }; diff --git a/modules/desktop/applications/communication.nix b/modules/desktop/applications/communication.nix new file mode 100644 index 0000000..7295db1 --- /dev/null +++ b/modules/desktop/applications/communication.nix @@ -0,0 +1,25 @@ +{ options, config, lib, pkgs, ... }: +let + inherit (lib.modules) mkIf mkForce mkMerge; + inherit (lib.attrsets) attrValues; + + cfg = config.modules.desktop.applications.office; +in +{ + options.modules.desktop.applications.office = let + inherit (lib.options) mkEnableOption; + in { + enable = mkEnableOption "Enable office suite (only-office)"; + }; + + config = mkIf cfg.enable + { + user.packages = attrValues { + inherit (pkgs) webcord teamspeak_client; + }; + + fonts.packages = with pkgs; [ + corefonts + ]; + }; +} diff --git a/modules/options.nix b/modules/options.nix index 71cba78..c02c84e 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -15,14 +15,14 @@ in { user = mkOpt attrs {}; - kaas = { + sneeuwvlok = { dir = mkOpt path (findFirst pathExists (toString ../.) [ "${config.user.home}/Github/.files" ]); - hostDir = mkOpt path "${config.kaas.dir}/hosts/${config.networking.hostName}"; - configDir = mkOpt path "${config.kaas.dir}/config"; - modulesDir = mkOpt path "${config.kaas.dir}/modules"; - themesDir = mkOpt path "${config.kaas.modulesDir}/themes"; + hostDir = mkOpt path "${config.sneeuwvlok.dir}/hosts/${config.networking.hostName}"; + configDir = mkOpt path "${config.sneeuwvlok.dir}/config"; + modulesDir = mkOpt path "${config.sneeuwvlok.dir}/modules"; + themesDir = mkOpt path "${config.sneeuwvlok.modulesDir}/themes"; }; }; diff --git a/modules/shell/default.nix b/modules/shell/default.nix index f858282..3c5c237 100644 --- a/modules/shell/default.nix +++ b/modules/shell/default.nix @@ -43,6 +43,13 @@ in rgFull = pkgs.ripgrep.override {withPCRE2 = true;}; }; + + programs = { + bat.enable = true; + eza.enable = true; + fzf.enable = true; + zoxide.enable = true; + }; }) ]; } diff --git a/modules/shell/toolset/git.nix b/modules/shell/toolset/git.nix index 05dad27..507a803 100644 --- a/modules/shell/toolset/git.nix +++ b/modules/shell/toolset/git.nix @@ -95,6 +95,7 @@ in tag.gpgSign = true; push = { + autoSetupRemote = true; default = "current"; gpgSign = "if-asked"; autoSquash = true; diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index e895fb0..e542f8c 100644 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -55,6 +55,34 @@ in pkg = zsh-nix-shell; file = "nix-shell.plugin.zsh"; }) + + { + name = "zsh-autosuggestion"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-autosuggestions"; + rev = "v0.7.0"; + sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98"; + }; + } + { + name = "zsh-completions"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-completions"; + rev = "0.34.0"; + sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9"; + }; + } + { + name = "zsh-syntax-highlighting"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-syntax-highlighting"; + rev = "0.7.0"; + sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r"; + }; + } ]; syntaxHighlighting = let @@ -135,7 +163,7 @@ in create.configFile.zsh-abbreviations = { target = "zsh/abbreviations"; text = let - abbrevs = import "${config.kaas.configDir}/shell-abbr"; + abbrevs = import "${config.sneeuwvlok.configDir}/shell-abbr"; in '' ${concatStrings (mapAttrsToList (k: v: "abbr ${k}=${escapeNixString v}") diff --git a/users/chris.nix b/users/chris.nix deleted file mode 100644 index 792bd43..0000000 --- a/users/chris.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, pkgs, ... }: -{ - home = { - username = "chris"; - homeDirectory = "/home/chris"; - stateVersion = "23.11"; # DO NOT CHANGE - - packages = [ - ]; - - file = { - }; - - sessionVariables = { - EDITOR = "nvim"; - }; - }; - - imports = [ - ../modules/home-manager/gpg.nix - ../modules/home-manager/desktop.nix - ../modules/home-manager/terminals/default.nix - ]; - - programs = { - home-manager.enable = true; - - git = { - enable = true; - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; - - ignores = [ "*~" "*.swp" ]; - aliases = { - ci = "commit"; - }; - extraConfig = {}; - }; - - lazygit.enable = true; - }; -} diff --git a/users/root.nix b/users/root.nix deleted file mode 100644 index 5818288..0000000 --- a/users/root.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, pkgs, ... }: -{ - home = { - username = "root"; - homeDirectory = "/home/root"; - stateVersion = "23.11"; # DO NOT CHANGE - - packages = [ - ]; - - file = { - }; - - sessionVariables = { - EDITOR = "nvim"; - }; - }; - - imports = [ - ../modules/home-manager/gpg.nix - ../modules/home-manager/desktop.nix - ../modules/home-manager/terminals/default.nix - ]; - - programs = { - home-manager.enable = true; - - git = { - enable = true; - userName = "Chris Kruining"; - userEmail = "chris@kruining.eu"; - - ignores = [ "*~" "*.swp" ]; - aliases = { - ci = "commit"; - }; - extraConfig = {}; - }; - - lazygit.enable = true; - }; -}