diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6e6373e --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "NixOS system"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + { + nixosConfigurations = { + "20212060" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./machines/laptop.nix + ../hardware-configuration.nix + ]; + }; + }; + }; +} diff --git a/modules/base/default.nix b/modules/base/default.nix index 7c78a9c..ce1e08a 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -29,11 +29,30 @@ in unzip # TODO: MOVE - quickemu + quickemu # TODO: Reenable once building this is fixed pdftk + + # TODO: Move to USB module + # usbutils + # udiskie + # udisks ]; - virtualisation.docker.enable = true; + security.krb5 = { + enable = true; + settings = { + libdefaults = { + rdns = false; + }; + realms = { + "GEWISWG.GEWIS.NL" = { + kdc = [ + "https://gewisvdesktop.gewis.nl/KdcProxy" + ]; + }; + }; + }; + }; modules = { # Enable base modules @@ -42,7 +61,7 @@ in neovim.enable = true; systemd-boot.enable = true; tuigreet.enable = true; - tailscale.enable = true; + # tailscale.enable = true; }; # TODO: Remove everything below, it is here out of convenience and should be elsewhere @@ -50,6 +69,10 @@ in # "9.9.9.9" # "149.112.112.112" # ]; + # programs.captive-browser.enable = true; + services.resolved = { + enable = true; + }; networking.firewall.enable = true; programs.dconf.enable = true; services.libinput.enable = true; @@ -58,5 +81,10 @@ in "nvidia-x11" "nvidia-settings" ]; + nix.settings.experimental-features = "nix-command flakes"; + + # TODO: Move to USB module + # services.gvfs.enable = true; + services.udisks2.enable = true; }; } diff --git a/modules/users/default.nix b/modules/users/default.nix index bad61ce..2218a73 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -63,6 +63,11 @@ in ]; options = { + machine.sudo-groups = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "Groups assigned to sudo users."; + }; machine.users = mkOption { type = types.attrsOf userModule; default = { }; @@ -90,10 +95,12 @@ in users.users = attrsets.concatMapAttrs (name: value: { ${name} = { isNormalUser = true; - extraGroups = mkIf value.sudo [ - "wheel" - "docker" - ]; + extraGroups = mkIf value.sudo ( + [ + "wheel" + ] + ++ config.machine.sudo-groups + ); }; }) config.machine.users; diff --git a/modules/users/modules/browser/qutebrowser/default.nix b/modules/users/modules/browser/qutebrowser/default.nix index a7ba91f..2c50e99 100644 --- a/modules/users/modules/browser/qutebrowser/default.nix +++ b/modules/users/modules/browser/qutebrowser/default.nix @@ -40,7 +40,7 @@ in enable = true; extraConfig = '' - config.set("completion.web_history.max_items", 100) + # config.set("completion.web_history.max_items", 30) config.set("colors.webpage.darkmode.enabled", False) config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}") config.set("fonts.default_family", "${theme.fonts.monospace.name}") diff --git a/modules/users/modules/default.nix b/modules/users/modules/default.nix index 5be22b1..3d8afad 100644 --- a/modules/users/modules/default.nix +++ b/modules/users/modules/default.nix @@ -9,9 +9,11 @@ ./browser/default.nix ./btop/default.nix ./desktop/default.nix + ./development/default.nix ./discord/default.nix ./feishin/default.nix ./fontconfig/default.nix + ./games/modrinth.nix ./git/default.nix ./language/cpp.nix ./language/haskell.nix diff --git a/modules/users/modules/desktop/window-manager/river.nix b/modules/users/modules/desktop/window-manager/river.nix index 9a5834a..d29babd 100644 --- a/modules/users/modules/desktop/window-manager/river.nix +++ b/modules/users/modules/desktop/window-manager/river.nix @@ -27,6 +27,8 @@ in brightnessctl river-filtile # owm + + udiskie # TODO: Move to USB module ]; # Change desktop to execute river @@ -106,10 +108,12 @@ in border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color; border-color-urgent = "0x${colors.fg}"; + # TODO: Make a desktop options for DE applications spawn = [ "\"${layout} ${layoutOptions}\"" "waybar" # TODO: Decouple "\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\"" + "udiskie" ]; map = ( lib.attrsets.recursiveUpdate @@ -124,7 +128,8 @@ in "${ssm} Return" = "spawn foot"; "${main} P" = "spawn \"rofi -show drun\""; "${ssm} P" = "spawn rofi-rbw"; - "${main} S" = "spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\""; + "${main} S" = + "spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\""; # Window focus "${main} J" = "focus-view next"; diff --git a/modules/users/modules/development/default.nix b/modules/users/modules/development/default.nix new file mode 100644 index 0000000..a77922f --- /dev/null +++ b/modules/users/modules/development/default.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + imports = [ + # Import systemwide configuration files. + ./utilities/docker.nix + ]; +} diff --git a/modules/users/modules/development/utilities/docker.nix b/modules/users/modules/development/utilities/docker.nix new file mode 100644 index 0000000..67ba34c --- /dev/null +++ b/modules/users/modules/development/utilities/docker.nix @@ -0,0 +1,41 @@ +{ + lib, + config, + pkgs, + ... +}: + +with lib; +let + cfg = config.modules.docker; +in +{ + options.modules.docker = { + enable = mkEnableOption "docker"; + }; + + config = mkIf cfg.enable { + # Development packages + home.packages = with pkgs; [ + docker + docker-compose + ]; + + # Allow unfree + modules.unfree.allowedPackages = [ + ]; + + # VSCode configuration + programs.vscode = { + extensions = with pkgs.vscode-extensions; [ + ms-azuretools.vscode-docker + ]; + + userSettings = { + }; + }; + + # Neovim configuration + programs.nixvim = { }; + }; +} diff --git a/modules/users/modules/games/modrinth.nix b/modules/users/modules/games/modrinth.nix new file mode 100644 index 0000000..c27c7e6 --- /dev/null +++ b/modules/users/modules/games/modrinth.nix @@ -0,0 +1,27 @@ +{ + lib, + config, + pkgs, + ... +}: + +with lib; +let + cfg = config.modules.modrinth; +in +{ + options.modules.modrinth = { + enable = mkEnableOption "modrinth"; + }; + + config = mkIf cfg.enable { + modules.unfree.allowedPackages = [ + "modrinth-app" + "modrinth-app-unwrapped" + ]; + + home.packages = with pkgs; [ + modrinth-app + ]; + }; +} diff --git a/modules/users/modules/language/cpp.nix b/modules/users/modules/language/cpp.nix index 71ba847..c645c02 100644 --- a/modules/users/modules/language/cpp.nix +++ b/modules/users/modules/language/cpp.nix @@ -19,9 +19,9 @@ in modules.unfree.allowedPackages = [ "vscode-extension-ms-vscode-cpptools" # TODO: Remove, it should not be here - "android-studio-stable" - "android-sdk-cmdline-tools" - "android-sdk-tools" + # "android-studio-stable" + # "android-sdk-cmdline-tools" + # "android-sdk-tools" ]; # Gitignore additions diff --git a/modules/users/modules/language/jupyter.nix b/modules/users/modules/language/jupyter.nix index dd8dc1a..15c5b4d 100644 --- a/modules/users/modules/language/jupyter.nix +++ b/modules/users/modules/language/jupyter.nix @@ -5,6 +5,7 @@ ... }: +# TODO: Move to a module for notebooks in general with lib; let cfg = config.modules.jupyter; @@ -16,7 +17,9 @@ in config = mkIf cfg.enable { # Development packages - home.packages = with pkgs; [ ]; + home.packages = with pkgs; [ + evcxr + ]; modules.python.extraPythonPackages = p: [ p.jupyter diff --git a/modules/users/modules/steam/default.nix b/modules/users/modules/steam/default.nix index c71a984..01f3021 100644 --- a/modules/users/modules/steam/default.nix +++ b/modules/users/modules/steam/default.nix @@ -10,4 +10,4 @@ with lib; options.modules.steam = { enable = mkEnableOption "steam"; }; -} \ No newline at end of file +} diff --git a/modules/users/modules/systemwide/default.nix b/modules/users/modules/systemwide/default.nix index 62bb6a0..97d1c08 100644 --- a/modules/users/modules/systemwide/default.nix +++ b/modules/users/modules/systemwide/default.nix @@ -3,6 +3,7 @@ { imports = [ # Import systemwide configuration files. + ./docker.nix ./river.nix ./steam.nix ./waylock.nix diff --git a/modules/users/modules/systemwide/docker.nix b/modules/users/modules/systemwide/docker.nix new file mode 100644 index 0000000..63aac04 --- /dev/null +++ b/modules/users/modules/systemwide/docker.nix @@ -0,0 +1,17 @@ +{ + lib, + config, + pkgs, + ... +}: + +with lib; +let + enabled = any (user: user.modules.docker.enable) (attrValues config.home-manager.users); +in +{ + config = mkIf enabled { + virtualisation.docker.enable = true; + machine.sudo-groups = [ "docker" ]; + }; +} diff --git a/modules/users/modules/systemwide/steam.nix b/modules/users/modules/systemwide/steam.nix index 8e62f0a..a99d7c4 100644 --- a/modules/users/modules/systemwide/steam.nix +++ b/modules/users/modules/systemwide/steam.nix @@ -1,7 +1,6 @@ { lib, config, - pkgs, ... }: diff --git a/modules/users/modules/vscode/default.nix b/modules/users/modules/vscode/default.nix index 88c467b..85007f7 100644 --- a/modules/users/modules/vscode/default.nix +++ b/modules/users/modules/vscode/default.nix @@ -47,7 +47,6 @@ in github.copilot-chat tomoki1207.pdf ms-vsliveshare.vsliveshare - ms-azuretools.vscode-docker ]; userSettings = { diff --git a/pkgs/default.nix b/pkgs/default.nix index 7129351..4a8ad5a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,7 +4,7 @@ { nixpkgs.config = { - android_sdk.accept_license = true; + # android_sdk.accept_license = true; # TODO: Move to android module packageOverrides = pkgs: { dina-vector = pkgs.callPackage ./fonts/dina-vector.nix { }; wqy-zenhei = pkgs.callPackage ./fonts/wqy-zenhei.nix { }; diff --git a/users/jan.nix b/users/jan.nix index 2cd7abd..d5dc6b1 100644 --- a/users/jan.nix +++ b/users/jan.nix @@ -12,15 +12,17 @@ libreoffice-still remmina # dina-vector - android-studio - docker - docker-compose - jellyfin-tui + # android-studio + # jellyfin-tui pinentry thunderbird signal-desktop + prusa-slicer + freecad-wayland + # appflowy ]; + # TODO: Move to gpg module programs.gpg = { enable = true; mutableKeys = true; @@ -62,10 +64,11 @@ # Gaming steam.enable = true; + modrinth.enable = true; # Media spotify.enable = true; - feishin.enable = true; + feishin.enable = false; # Tools rofi-rbw.enable = true; @@ -84,6 +87,7 @@ # Development neovim.enable = true; vscode.enable = true; + docker.enable = true; # Languages haskell.enable = false; @@ -118,24 +122,14 @@ darkMode = false; }; themes.catppuccin = { - enable = false; - flavor = "latte"; + enable = true; + flavor = "mocha"; }; themes.sakura.enable = false; themes.nord = { - enable = true; + enable = false; darkMode = true; }; - - # TODO: Remove - # Nice themes: - # - rose-pine-dawn: Decent, bit too yellow though. - # - sagelight: Barely readable - # - danqing-light: Too minty - # - fruit-soda: Colors too bright, background too dark. - # - solarflare-light: Nice - # darkMode = false; - # colorScheme = "${pkgs.base16-schemes}/share/themes/solarflare-light.yaml"; }; # TODO: Remove everything below, it is here out of convenience and should be elsewhere