This commit is contained in:
Jan-Bulthuis 2025-01-24 00:28:22 +01:00
parent eab7a2b5ad
commit b4ad26555f
18 changed files with 187 additions and 35 deletions

21
flake.nix Normal file
View File

@ -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
];
};
};
};
}

View File

@ -29,11 +29,30 @@ in
unzip unzip
# TODO: MOVE # TODO: MOVE
quickemu quickemu # TODO: Reenable once building this is fixed
pdftk 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 = { modules = {
# Enable base modules # Enable base modules
@ -42,7 +61,7 @@ in
neovim.enable = true; neovim.enable = true;
systemd-boot.enable = true; systemd-boot.enable = true;
tuigreet.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 # TODO: Remove everything below, it is here out of convenience and should be elsewhere
@ -50,6 +69,10 @@ in
# "9.9.9.9" # "9.9.9.9"
# "149.112.112.112" # "149.112.112.112"
# ]; # ];
# programs.captive-browser.enable = true;
services.resolved = {
enable = true;
};
networking.firewall.enable = true; networking.firewall.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
services.libinput.enable = true; services.libinput.enable = true;
@ -58,5 +81,10 @@ in
"nvidia-x11" "nvidia-x11"
"nvidia-settings" "nvidia-settings"
]; ];
nix.settings.experimental-features = "nix-command flakes";
# TODO: Move to USB module
# services.gvfs.enable = true;
services.udisks2.enable = true;
}; };
} }

View File

@ -63,6 +63,11 @@ in
]; ];
options = { options = {
machine.sudo-groups = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Groups assigned to sudo users.";
};
machine.users = mkOption { machine.users = mkOption {
type = types.attrsOf userModule; type = types.attrsOf userModule;
default = { }; default = { };
@ -90,10 +95,12 @@ in
users.users = attrsets.concatMapAttrs (name: value: { users.users = attrsets.concatMapAttrs (name: value: {
${name} = { ${name} = {
isNormalUser = true; isNormalUser = true;
extraGroups = mkIf value.sudo [ extraGroups = mkIf value.sudo (
[
"wheel" "wheel"
"docker" ]
]; ++ config.machine.sudo-groups
);
}; };
}) config.machine.users; }) config.machine.users;

View File

@ -40,7 +40,7 @@ in
enable = true; enable = true;
extraConfig = '' 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.darkmode.enabled", False)
config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}") config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}")
config.set("fonts.default_family", "${theme.fonts.monospace.name}") config.set("fonts.default_family", "${theme.fonts.monospace.name}")

View File

@ -9,9 +9,11 @@
./browser/default.nix ./browser/default.nix
./btop/default.nix ./btop/default.nix
./desktop/default.nix ./desktop/default.nix
./development/default.nix
./discord/default.nix ./discord/default.nix
./feishin/default.nix ./feishin/default.nix
./fontconfig/default.nix ./fontconfig/default.nix
./games/modrinth.nix
./git/default.nix ./git/default.nix
./language/cpp.nix ./language/cpp.nix
./language/haskell.nix ./language/haskell.nix

View File

@ -27,6 +27,8 @@ in
brightnessctl brightnessctl
river-filtile river-filtile
# owm # owm
udiskie # TODO: Move to USB module
]; ];
# Change desktop to execute river # 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-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color;
border-color-urgent = "0x${colors.fg}"; border-color-urgent = "0x${colors.fg}";
# TODO: Make a desktop options for DE applications
spawn = [ spawn = [
"\"${layout} ${layoutOptions}\"" "\"${layout} ${layoutOptions}\""
"waybar" # TODO: Decouple "waybar" # TODO: Decouple
"\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\"" "\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\""
"udiskie"
]; ];
map = ( map = (
lib.attrsets.recursiveUpdate lib.attrsets.recursiveUpdate
@ -124,7 +128,8 @@ in
"${ssm} Return" = "spawn foot"; "${ssm} Return" = "spawn foot";
"${main} P" = "spawn \"rofi -show drun\""; "${main} P" = "spawn \"rofi -show drun\"";
"${ssm} P" = "spawn rofi-rbw"; "${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 # Window focus
"${main} J" = "focus-view next"; "${main} J" = "focus-view next";

View File

@ -0,0 +1,8 @@
{ ... }:
{
imports = [
# Import systemwide configuration files.
./utilities/docker.nix
];
}

View File

@ -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 = { };
};
}

View File

@ -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
];
};
}

View File

@ -19,9 +19,9 @@ in
modules.unfree.allowedPackages = [ modules.unfree.allowedPackages = [
"vscode-extension-ms-vscode-cpptools" "vscode-extension-ms-vscode-cpptools"
# TODO: Remove, it should not be here # TODO: Remove, it should not be here
"android-studio-stable" # "android-studio-stable"
"android-sdk-cmdline-tools" # "android-sdk-cmdline-tools"
"android-sdk-tools" # "android-sdk-tools"
]; ];
# Gitignore additions # Gitignore additions

View File

@ -5,6 +5,7 @@
... ...
}: }:
# TODO: Move to a module for notebooks in general
with lib; with lib;
let let
cfg = config.modules.jupyter; cfg = config.modules.jupyter;
@ -16,7 +17,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Development packages # Development packages
home.packages = with pkgs; [ ]; home.packages = with pkgs; [
evcxr
];
modules.python.extraPythonPackages = p: [ modules.python.extraPythonPackages = p: [
p.jupyter p.jupyter

View File

@ -3,6 +3,7 @@
{ {
imports = [ imports = [
# Import systemwide configuration files. # Import systemwide configuration files.
./docker.nix
./river.nix ./river.nix
./steam.nix ./steam.nix
./waylock.nix ./waylock.nix

View File

@ -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" ];
};
}

View File

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: }:

View File

@ -47,7 +47,6 @@ in
github.copilot-chat github.copilot-chat
tomoki1207.pdf tomoki1207.pdf
ms-vsliveshare.vsliveshare ms-vsliveshare.vsliveshare
ms-azuretools.vscode-docker
]; ];
userSettings = { userSettings = {

View File

@ -4,7 +4,7 @@
{ {
nixpkgs.config = { nixpkgs.config = {
android_sdk.accept_license = true; # android_sdk.accept_license = true; # TODO: Move to android module
packageOverrides = pkgs: { packageOverrides = pkgs: {
dina-vector = pkgs.callPackage ./fonts/dina-vector.nix { }; dina-vector = pkgs.callPackage ./fonts/dina-vector.nix { };
wqy-zenhei = pkgs.callPackage ./fonts/wqy-zenhei.nix { }; wqy-zenhei = pkgs.callPackage ./fonts/wqy-zenhei.nix { };

View File

@ -12,15 +12,17 @@
libreoffice-still libreoffice-still
remmina remmina
# dina-vector # dina-vector
android-studio # android-studio
docker # jellyfin-tui
docker-compose
jellyfin-tui
pinentry pinentry
thunderbird thunderbird
signal-desktop signal-desktop
prusa-slicer
freecad-wayland
# appflowy
]; ];
# TODO: Move to gpg module
programs.gpg = { programs.gpg = {
enable = true; enable = true;
mutableKeys = true; mutableKeys = true;
@ -62,10 +64,11 @@
# Gaming # Gaming
steam.enable = true; steam.enable = true;
modrinth.enable = true;
# Media # Media
spotify.enable = true; spotify.enable = true;
feishin.enable = true; feishin.enable = false;
# Tools # Tools
rofi-rbw.enable = true; rofi-rbw.enable = true;
@ -84,6 +87,7 @@
# Development # Development
neovim.enable = true; neovim.enable = true;
vscode.enable = true; vscode.enable = true;
docker.enable = true;
# Languages # Languages
haskell.enable = false; haskell.enable = false;
@ -118,24 +122,14 @@
darkMode = false; darkMode = false;
}; };
themes.catppuccin = { themes.catppuccin = {
enable = false; enable = true;
flavor = "latte"; flavor = "mocha";
}; };
themes.sakura.enable = false; themes.sakura.enable = false;
themes.nord = { themes.nord = {
enable = true; enable = false;
darkMode = true; 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 # TODO: Remove everything below, it is here out of convenience and should be elsewhere