From 6b44ec946b534cfcca914c862eb6289bcd953cac Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Sun, 9 Mar 2025 23:30:26 +0100 Subject: [PATCH] various stuff --- default.nix | 2 +- flake.lock | 224 ++++++++++++------ flake.nix | 7 +- hosts/chris-laptop/default.nix | 2 +- hosts/chris-pc/default.nix | 4 +- hosts/chris-pc/users/chris.nix | 65 +++++ hosts/mam-laptop/default.nix | 17 +- lib/nixos.nix | 1 + .../desktop/applications/communication.nix | 2 +- modules/desktop/editors/nvim.nix | 40 +--- modules/desktop/plasma.nix | 2 +- modules/options.nix | 33 ++- modules/services/games/minecraft.nix | 2 +- modules/system/security.nix | 13 +- modules/themes/default.nix | 8 + 15 files changed, 288 insertions(+), 134 deletions(-) create mode 100644 hosts/chris-pc/users/chris.nix diff --git a/default.nix b/default.nix index 84e8f62..506c00a 100644 --- a/default.nix +++ b/default.nix @@ -8,7 +8,7 @@ in { imports = [ inputs.home-manager.nixosModules.home-manager - inputs.nixvim.nixosModules.nixvim + inputs.nvf.nixosModules.default inputs.stylix.nixosModules.stylix inputs.nix-minecraft.nixosModules.minecraft-servers inputs.sops-nix.nixosModules.sops diff --git a/flake.lock b/flake.lock index b91fda1..3317d05 100644 --- a/flake.lock +++ b/flake.lock @@ -190,10 +190,7 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1738453229, @@ -446,34 +443,6 @@ "type": "github" } }, - "ixx": { - "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], - "nixpkgs": [ - "nixvim", - "nuschtosSearch", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", - "owner": "NuschtOS", - "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "ref": "v0.0.6", - "repo": "ixx", - "type": "github" - } - }, "lib-aggregate": { "inputs": { "flake-utils": "flake-utils", @@ -493,6 +462,21 @@ "type": "github" } }, + "mnw": { + "locked": { + "lastModified": 1738852285, + "narHash": "sha256-8Y1uyE6gGHxdU0Vcx2CMg/dAmDSxJw19aAl3TKbbo54=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "6ae73dc9cb72cea17bcc2e3d4670825f483e80e8", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, "mozilla": { "flake": false, "locked": { @@ -509,6 +493,32 @@ "type": "github" } }, + "nil": { + "inputs": { + "flake-utils": [ + "nvf", + "flake-utils" + ], + "nixpkgs": [ + "nvf", + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1732053863, + "narHash": "sha256-DCIVdlb81Fct2uwzbtnawLBC/U03U2hqx8trqTJB7WA=", + "owner": "oxalica", + "repo": "nil", + "rev": "2e24c9834e3bb5aa2a3701d3713b43a6fb106362", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, "nix-minecraft": { "inputs": { "flake-compat": "flake-compat_2", @@ -529,6 +539,21 @@ "type": "github" } }, + "nixos-boot": { + "locked": { + "lastModified": 1722927293, + "narHash": "sha256-8oCsiFyAuidAdhSz60Lu8+TwCPHxaeWixyv0xT0mLt4=", + "owner": "Melkor333", + "repo": "nixos-boot", + "rev": "afaed735149d0a06f234e54dd2d9db2e18dc64ae", + "type": "github" + }, + "original": { + "owner": "Melkor333", + "repo": "nixos-boot", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1740695751, @@ -560,6 +585,18 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1738452942, + "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1740828860, @@ -625,6 +662,22 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1740303746, + "narHash": "sha256-XcdiWLEhjJkMxDLKQJ0CCivmYYCvA5MDxu9pMybM5kM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2d068ae5c6516b2d04562de50a58c682540de9bf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1731763621, "narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=", @@ -640,7 +693,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1740367490, "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", @@ -656,7 +709,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1727348695, "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", @@ -672,26 +725,20 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": [ - "nixpkgs" - ], - "nuschtosSearch": "nuschtosSearch" - }, + "nmd": { + "flake": false, "locked": { - "lastModified": 1740520037, - "narHash": "sha256-TpZMYjOre+6GhKDVHFwoW2iBWqpNQppQTuqIAo+OBV8=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "6f8d8f7aee84f377f52c8bb58385015f9168a666", - "type": "github" + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" }, "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" } }, "nur": { @@ -717,26 +764,27 @@ "type": "github" } }, - "nuschtosSearch": { + "nvf": { "inputs": { + "flake-parts": "flake-parts", "flake-utils": "flake-utils_3", - "ixx": "ixx", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] + "mnw": "mnw", + "nil": "nil", + "nixpkgs": "nixpkgs_5", + "nmd": "nmd", + "systems": "systems_4" }, "locked": { - "lastModified": 1738508923, - "narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=", - "owner": "NuschtOS", - "repo": "search", - "rev": "86e2038290859006e05ca7201425ea5b5de4aecb", + "lastModified": 1741546504, + "narHash": "sha256-dtdj9RWtsIiSa0H6XDY3c9gXKMN22RxgIvQtMHArd3w=", + "owner": "notashelf", + "repo": "nvf", + "rev": "c8fd6204d02596462e354cf35b029cd6a86ce24b", "type": "github" }, "original": { - "owner": "NuschtOS", - "repo": "search", + "owner": "notashelf", + "repo": "nvf", "type": "github" } }, @@ -770,9 +818,10 @@ "flux": "flux", "home-manager": "home-manager", "nix-minecraft": "nix-minecraft", + "nixos-boot": "nixos-boot", "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable", - "nixvim": "nixvim", + "nvf": "nvf", "plasma-manager": "plasma-manager", "sops-nix": "sops-nix", "stylix": "stylix", @@ -796,9 +845,31 @@ "type": "github" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nvf", + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731983527, + "narHash": "sha256-JECaBgC0pQ91Hq3W4unH6K9to8s2Zl2sPNu7bLOv4ek=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "71287228d96e9568e1e70c6bbfa3f992d145947b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1741043164, @@ -826,9 +897,9 @@ "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "nur": "nur", - "systems": "systems_4", + "systems": "systems_5", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -909,6 +980,21 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1015,7 +1101,7 @@ }, "zen-browser": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1727721329, diff --git a/flake.nix b/flake.nix index 5834d70..dcd01a5 100644 --- a/flake.nix +++ b/flake.nix @@ -16,10 +16,9 @@ inputs.home-manager.follows = "home-manager"; }; - nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + nvf.url = "github:notashelf/nvf"; + + nixos-boot.url = "github:Melkor333/nixos-boot"; firefox.url = "github:nix-community/flake-firefox-nightly"; diff --git a/hosts/chris-laptop/default.nix b/hosts/chris-laptop/default.nix index 7e4b5e9..4c3296e 100644 --- a/hosts/chris-laptop/default.nix +++ b/hosts/chris-laptop/default.nix @@ -9,7 +9,7 @@ polarity = "dark"; }; - system.audio = true; + system.audio.enable = true; networking.enable = true; desktop = { diff --git a/hosts/chris-pc/default.nix b/hosts/chris-pc/default.nix index 228d7b3..f35de8d 100644 --- a/hosts/chris-pc/default.nix +++ b/hosts/chris-pc/default.nix @@ -2,6 +2,8 @@ { imports = [ ./hardware.nix ]; + user.name = "chris"; + fileSystems."/home/chris/games" = { device = "/dev/disk/by-label/games"; fsType = "ext4"; @@ -52,7 +54,7 @@ }; editors = { - default = "nano"; + default = "zed"; vscodium.enable = true; zed.enable = true; nvim.enable = true; diff --git a/hosts/chris-pc/users/chris.nix b/hosts/chris-pc/users/chris.nix new file mode 100644 index 0000000..ebbe342 --- /dev/null +++ b/hosts/chris-pc/users/chris.nix @@ -0,0 +1,65 @@ +// { config, lib, pkgs, ... }: +// { +// full_name = "WOOT"; + +// modules = { +// themes = { +// enable = true; +// theme = "everforest"; +// polarity = "dark"; +// }; + +// develop = { +// rust.enable = true; +// js.enable = true; +// dotnet.enable = true; +// }; + +// # EXPERIMENTS +// # services.games.minecraft.enable = true; +// services.auth.enable = true; + +// desktop = { +// plasma.enable = true; +// type = "wayland"; + +// applications = { +// communication.enable = true; +// email.enable = true; +// office.enable = true; +// steam.enable = true; +// recording.enable = true; +// }; + +// terminal = { +// default = "ghostty"; +// alacritty.enable = true; +// ghostty.enable = true; +// }; + +// editors = { +// default = "zed"; +// vscodium.enable = true; +// zed.enable = true; +// nvim.enable = true; +// nano.enable = true; +// kate.enable = true; +// }; + +// browsers = { +// default = "chromium"; +// firefox.enable = true; +// chrome.enable = true; +// }; + +// games = { +// minecraft.enable = true; +// }; +// }; + +// shell = { +// default = "zsh"; +// corePkgs.enable = true; +// }; +// }; +// } diff --git a/hosts/mam-laptop/default.nix b/hosts/mam-laptop/default.nix index aeb295b..b87282e 100644 --- a/hosts/mam-laptop/default.nix +++ b/hosts/mam-laptop/default.nix @@ -1,15 +1,21 @@ { config, lib, pkgs, ... }: { - imports = [ ./hardware.nix ]; + # imports = [ ./hardware.nix ]; + + user_name = "moeke"; + # user = { + # name = "moeke"; + # display_name = "Ons mam"; + # }; modules = { themes = { enable = true; theme = "everforest"; - polarity = "dark"; + polarity = "light"; }; - system.audio = true; + system.audio.enable = true; networking.enable = true; desktop = { @@ -26,9 +32,8 @@ }; browsers = { - default = "firefox"; - firefox.enable = true; - firefox.privacy.enable = true; + default = "chrome"; + chrome.enable=true; }; }; diff --git a/lib/nixos.nix b/lib/nixos.nix index faf9194..31fc570 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -15,6 +15,7 @@ in rec specialArgs = { inherit lib inputs system; }; modules = [ + inputs.nixos-boot.nixosModules.default { nixpkgs.pkgs = pkgs; networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path)); diff --git a/modules/desktop/applications/communication.nix b/modules/desktop/applications/communication.nix index 62ab953..9b9e5cc 100644 --- a/modules/desktop/applications/communication.nix +++ b/modules/desktop/applications/communication.nix @@ -15,7 +15,7 @@ in config = mkIf cfg.enable { user.packages = attrValues { - inherit (pkgs) vesktop teamspeak_client whatsapp-for-linux; + inherit (pkgs) vesktop teamspeak_client; }; }; } diff --git a/modules/desktop/editors/nvim.nix b/modules/desktop/editors/nvim.nix index d3bca3b..2bdc84a 100644 --- a/modules/desktop/editors/nvim.nix +++ b/modules/desktop/editors/nvim.nix @@ -9,39 +9,23 @@ in in { enable = mkEnableOption "neo-vim (nixvim)"; }; config = mkIf config.modules.desktop.editors.nvim.enable { - programs.nixvim = { + programs.nvf = { enable = true; + settings = { + vim = { + statusline.lualine.enable = true; + telescope.enable = true; + autocomplete.nvim-cmp.enable = true; - opts = { - number = true; + languages = { + enableLSP = true; + enableTreesitter = true; - shiftwidth = 2; - }; - -# colorschemes.base16 = "${pkgs.base16-schemes}/share/themes/everforest.yaml"; -# colorschemes.everforest.enable = true; - - plugins = { - lualine.enable = true; - lightline.enable = true; - - lsp = { - enable = true; - servers = { - ts_ls.enable = true; - lua_ls.enable = true; - rust_analyzer = { - enable = true; - installRustc = true; - installCargo = true; - }; + nix.enable = true; + ts.enable = true; + rust.enable = true; }; }; - - cmp = { - enable = true; - autoEnableSources = true; - }; }; }; }; diff --git a/modules/desktop/plasma.nix b/modules/desktop/plasma.nix index fa1be31..c2fd5c9 100644 --- a/modules/desktop/plasma.nix +++ b/modules/desktop/plasma.nix @@ -19,7 +19,7 @@ in }; autoLogin = { enable = true; - user = "chris"; + user = config.user.name; }; }; diff --git a/modules/options.nix b/modules/options.nix index 8aff7da..67def04 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -1,16 +1,13 @@ { inputs, config, options, lib, pkgs, ... }: let - inherit (builtins) elem isList pathExists toString; - inherit (lib.attrsets) mapAttrs mapAttrsToList; + inherit (builtins) pathExists toString; inherit (lib.lists) findFirst; inherit (lib.modules) mkAliasDefinitions; - inherit (lib.strings) concatMapStringsSep concatStringsSep; - inherit (lib.my) mkOpt mkOpt'; in { options = let - inherit (lib.options) mkOption; - inherit (lib.types) attrs attrsOf either listOf oneOf path str; + inherit (lib.types) attrs path str; + inherit (lib.my) mkOpt; in { user = mkOpt attrs {}; @@ -31,19 +28,18 @@ in pkgs.sops ]; - user = let - user = builtins.getEnv "USER"; - name = - if builtins.elem user [ "" "root" ] then "chris" - else user; - in - { - inherit name; -# description = "Primary user account"; + nixos-boot = { + enable = true; + + bgColor = { red = 30; green = 30; blue = 30; }; + }; + + user = { + name = "chris"; description = "Chris Kruining"; extraGroups = [ "wheel" ]; isNormalUser = true; - home = "/home/${name}"; + home = "/home/chris"; group = "users"; uid = 1000; }; @@ -53,7 +49,6 @@ in useUserPackages = true; sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager - inputs.nixvim.homeManagerModules.nixvim ]; }; @@ -62,7 +57,9 @@ in sessionPath = [ "$SNEEUWVLOK_BIN" "$XDG_BIN_HOME" "$PATH" ]; }; - users.users.${config.user.name} = mkAliasDefinitions options.user; + users.users = { + ${config.user.name} = mkAliasDefinitions options.user; + }; nix.settings = let users = [ "root" config.user.name ]; in { diff --git a/modules/services/games/minecraft.nix b/modules/services/games/minecraft.nix index deb6598..e5478e8 100644 --- a/modules/services/games/minecraft.nix +++ b/modules/services/games/minecraft.nix @@ -48,7 +48,7 @@ in bypassesPlayerLimit = false; } ]; - jvmOpts = "-Xms4092M -Xmx4092M -XX:+UseG1GC -Djava.net.preferIPv4Stack=true"; + jvmOpts = "-Xms2048M -Xmx2048M -XX:+UseG1GC"; in { vanilla = { enable = true; diff --git a/modules/system/security.nix b/modules/system/security.nix index f012b5f..4a7fbac 100644 --- a/modules/system/security.nix +++ b/modules/system/security.nix @@ -9,9 +9,16 @@ sudo.execWheelOnly = true; acme.acceptTerms = true; polkit.enable = true; - pam.services.kwallet = { - name = "kwallet"; - enableKwallet = true; + pam = { + u2f = { + enable = true; + settings.cue = true; + }; + + services.kwallet = { + name = "kwallet"; + enableKwallet = true; + }; }; }; diff --git a/modules/themes/default.nix b/modules/themes/default.nix index 556af8e..fe1d53d 100644 --- a/modules/themes/default.nix +++ b/modules/themes/default.nix @@ -37,6 +37,14 @@ in { image = ./${cfg.theme}.jpg; polarity = cfg.polarity; + targets = { + grub.enable = true; + plymouth.enable = true; + console.enable = true; + nixos-icons.enable = true; + qt.enable = true; + }; + fonts = { serif = { package = pkgs.dejavu_fonts;