From 3a7d1784fa32dfb2050fdf610df8c991c374459a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 13:36:21 +0200 Subject: [PATCH] wip create meta configuration --- gnome.nix | 49 ------- home-ronja.nix | 119 ----------------- home-vinzenz.nix | 233 --------------------------------- kde.nix | 50 ------- common.nix => my/default.nix | 11 +- my/gnome.nix | 59 +++++++++ my/home-ronja.nix | 129 +++++++++++++++++++ my/home-vinzenz.nix | 243 +++++++++++++++++++++++++++++++++++ my/kde.nix | 60 +++++++++ vinzenz-lpt.nix | 9 +- vinzenz-pc3.nix | 2 +- 11 files changed, 506 insertions(+), 458 deletions(-) delete mode 100644 gnome.nix delete mode 100644 home-ronja.nix delete mode 100644 home-vinzenz.nix delete mode 100644 kde.nix rename common.nix => my/default.nix (95%) create mode 100644 my/gnome.nix create mode 100644 my/home-ronja.nix create mode 100644 my/home-vinzenz.nix create mode 100644 my/kde.nix diff --git a/gnome.nix b/gnome.nix deleted file mode 100644 index bc6aa4d..0000000 --- a/gnome.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - }; - - gnome = { - tracker-miners.enable = false; - tracker.enable = false; - }; - }; - - environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; - - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; - - home-manager.users = { - vinzenz = {pkgs, ...}: { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; - - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; - }; -} diff --git a/home-ronja.nix b/home-ronja.nix deleted file mode 100644 index 7bb3e87..0000000 --- a/home-ronja.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.ronja = { - isNormalUser = true; - description = "Ronja Spiegelberg"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.ronja = { - config, - pkgs, - ... - }: { - home = { - username = "ronja"; - homeDirectory = "/home/ronja"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - ## Apps - steam - telegram-desktop - powerline - powerline-fonts - lutris - kdiff3 - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "systemadmin"]; - }; - }; - - git = { - enable = true; - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; - }; -} diff --git a/home-vinzenz.nix b/home-vinzenz.nix deleted file mode 100644 index 41640a1..0000000 --- a/home-vinzenz.nix +++ /dev/null @@ -1,233 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - keepassxc - steam - insync - telegram-desktop - simple-scan - wireguard-tools - element-desktop - etcher - iotop - radeontop - lsof - wirelesstools - powerline - powerline-fonts - thefuck - dotnet-sdk_7 - jetbrains.rider - alejandra - arduino - uucp - screen - jetbrains.pycharm-professional - kdiff3 - docker - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - fzf.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - initExtra = '' - eval "$(direnv hook zsh)"; - eval $(thefuck --alias); - ''; - - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-fmt = "alejandra ."; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.ms-python.python - vscode-extensions.kamadorueda.alejandra - ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "workbench.startupEditor" = "readme"; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.enableExperiments" = false; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - bottom = { - enable = true; - settings = { - # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml - }; - }; - - exa = { - enable = true; - git = true; - icons = true; - enableAliases = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - }; -} diff --git a/kde.nix b/kde.nix deleted file mode 100644 index bebf59e..0000000 --- a/kde.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; - - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; - - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - }; - - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - - services.kdeconnect = { - enable = true; - indicator = true; - }; - }; -} diff --git a/common.nix b/my/default.nix similarity index 95% rename from common.nix rename to my/default.nix index f954f14..444be5a 100644 --- a/common.nix +++ b/my/default.nix @@ -2,9 +2,18 @@ config, pkgs, modulesPath, + lib, ... -}: { +}: +with lib; let + cfg = config.my; +in { imports = [ + ./gnome.nix + ./home-vinzenz.nix + ./home-ronja.nix + ./kde.nix + # enable home manager (modulesPath + "/installer/scan/not-detected.nix") diff --git a/my/gnome.nix b/my/gnome.nix new file mode 100644 index 0000000..5acffeb --- /dev/null +++ b/my/gnome.nix @@ -0,0 +1,59 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.gnome; +in { + options.my.gnome = { + enable = lib.mkEnableOption "gnome desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; + }; + + environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; + + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; + + home-manager.users = { + vinzenz = {pkgs, ...}: { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; + }; + }; +} diff --git a/my/home-ronja.nix b/my/home-ronja.nix new file mode 100644 index 0000000..c8cf4a2 --- /dev/null +++ b/my/home-ronja.nix @@ -0,0 +1,129 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.my.users.ronja; +in { + options.my.users.ronja = { + enable = lib.mkEnableOption "user ronja"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.ronja = { + isNormalUser = true; + description = "Ronja Spiegelberg"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.ronja = { + config, + pkgs, + ... + }: { + home = { + username = "ronja"; + homeDirectory = "/home/ronja"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + ## Apps + steam + telegram-desktop + powerline + powerline-fonts + lutris + kdiff3 + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "systemadmin"]; + }; + }; + + git = { + enable = true; + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; + }; + }; +} diff --git a/my/home-vinzenz.nix b/my/home-vinzenz.nix new file mode 100644 index 0000000..ceed7ff --- /dev/null +++ b/my/home-vinzenz.nix @@ -0,0 +1,243 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.users.vinzenz; +in { + options.my.users.vinzenz = { + enable = lib.mkEnableOption "user vinzenz"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + keepassxc + steam + insync + telegram-desktop + simple-scan + wireguard-tools + element-desktop + etcher + iotop + radeontop + lsof + wirelesstools + powerline + powerline-fonts + thefuck + dotnet-sdk_7 + jetbrains.rider + alejandra + arduino + uucp + screen + jetbrains.pycharm-professional + kdiff3 + docker + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + fzf.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; + + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-fmt = "alejandra ."; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + #package = pkgs.gitFull; + #config.credential.helper = "libsecret"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.ms-python.python + vscode-extensions.kamadorueda.alejandra + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "workbench.startupEditor" = "readme"; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.enableExperiments" = false; + }; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + bottom = { + enable = true; + settings = { + # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml + }; + }; + + exa = { + enable = true; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" + }; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; + }; + }; + }; +} diff --git a/my/kde.nix b/my/kde.nix new file mode 100644 index 0000000..26e65f8 --- /dev/null +++ b/my/kde.nix @@ -0,0 +1,60 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.kde; +in { + options.my.kde = { + enable = lib.mkEnableOption "KDE desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + desktopManager.plasma5.enable = true; + + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk + ]; + + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; + + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + packages = with pkgs; [ + ]; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 7b07dab..ccc550e 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -6,11 +6,10 @@ }: { networking.hostName = "vinzenz-lpt"; - imports = [ - ./common.nix - ./gnome.nix - ./home-vinzenz.nix - ]; + my.gnome.enable = true; + my.users.vinzenz.enable = true; + + imports = [./my/default.nix]; services.flatpak.enable = true; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 3c32a63..ea23225 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -60,7 +60,7 @@ fsType = "btrfs"; options = ["subvolid=5"]; }; - + "/mnt/ssd2" = { device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; fsType = "ext4";