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
# 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;
};
}

View File

@ -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 [
extraGroups = mkIf value.sudo (
[
"wheel"
"docker"
];
]
++ config.machine.sudo-groups
);
};
}) config.machine.users;

View File

@ -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}")

View File

@ -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

View File

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

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 = [
"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

View File

@ -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

View File

@ -3,6 +3,7 @@
{
imports = [
# Import systemwide configuration files.
./docker.nix
./river.nix
./steam.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,
config,
pkgs,
...
}:

View File

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

View File

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

View File

@ -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