Update formatter

This commit is contained in:
Fabian Hauser 2024-04-10 10:53:41 +07:00
parent 4eea2232fb
commit d8235cb2a9
55 changed files with 1031 additions and 664 deletions

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
environment.systemPackages = with pkgs; environment.systemPackages =
with pkgs;
[ [
vim vim
tmux tmux
@ -25,8 +31,20 @@
units units
powertop powertop
lm_sensors lm_sensors
] ++ [ nixfmt nix-index nix-diff nixpkgs-review nixos-option ] ]
++ [ autojump powerline-go ] ++ [ # File Utilities ++ [
nixfmt
nix-index
nix-diff
nixpkgs-review
nixos-option
]
++ [
autojump
powerline-go
]
++ [
# File Utilities
ripgrep ripgrep
unzip unzip
p7zip p7zip
@ -40,7 +58,9 @@
vimPlugins.airline vimPlugins.airline
git git
git-lfs git-lfs
] ++ [ # Filesystem & Disk Utilities ]
++ [
# Filesystem & Disk Utilities
exfat exfat
samba samba
cifs-utils cifs-utils
@ -52,7 +72,9 @@
smartmontools smartmontools
parted parted
usbutils usbutils
] ++ [ # Networking Utilities ]
++ [
# Networking Utilities
nmap nmap
bind bind
curl curl
@ -68,5 +90,4 @@
imapsync imapsync
bluez-tools bluez-tools
]; ];
} }

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
users = { users = {
@ -7,10 +12,15 @@ let
isNormalUser = true; isNormalUser = true;
description = "Fabian Hauser"; description = "Fabian Hauser";
group = "fhauser"; group = "fhauser";
extraGroups = extraGroups = [
[ "wheel" "video" "docker" "networkmanager" "libvirtd" "adbusers" ]; "wheel"
hashedPassword = "video"
"$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1"; "docker"
"networkmanager"
"libvirtd"
"adbusers"
];
hashedPassword = "$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108"
]; ];
@ -22,18 +32,22 @@ let
description = "Testuser empty0"; description = "Testuser empty0";
group = "empty0"; group = "empty0";
extraGroups = [ "video" ]; extraGroups = [ "video" ];
hashedPassword = hashedPassword = "$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
"$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
}; };
}; };
in { in
imports = [ ../../modules ./unfree.nix ./applications.nix ./overlays.nix ]; {
imports = [
../../modules
./unfree.nix
./applications.nix
./overlays.nix
];
boot.loader.timeout = 2; boot.loader.timeout = 2;
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
catppuccin.flavour = "mocha"; catppuccin.flavour = "mocha";
console.keyMap = "de_CH-latin1"; console.keyMap = "de_CH-latin1";
@ -46,17 +60,21 @@ in {
empty0.gid = 1003; empty0.gid = 1003;
}; };
users.users = users // { users.users = users // {
root.openssh.authorizedKeys.keys = with lib; root.openssh.authorizedKeys.keys =
concatLists (mapAttrsToList (name: user: with lib;
if elem "wheel" user.extraGroups then concatLists (
user.openssh.authorizedKeys.keys mapAttrsToList (
else name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else [ ]
[ ]) users); ) users
);
}; };
# Package management # Package management
nix = { nix = {
settings.trusted-users = [ "root" "@wheel" ]; settings.trusted-users = [
"root"
"@wheel"
];
optimise.automatic = true; optimise.automatic = true;
gc = { gc = {
automatic = true; automatic = true;

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, options, ... }: {
config,
lib,
pkgs,
options,
...
}:
{ {
nixpkgs.overlays = [ (import ../../overlays) ]; nixpkgs.overlays = [ (import ../../overlays) ];

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [ builtins.elem (lib.getName pkg) [
"unrar" "unrar"

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
@ -14,24 +19,26 @@
''; '';
# request-key expects a configuration file under /etc # request-key expects a configuration file under /etc
environment.etc."request-key.conf" = { environment.etc."request-key.conf" = {
text = let text =
upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; let
keyctl = "${pkgs.keyutils}/bin/keyctl"; upcall = "${pkgs.cifs-utils}/bin/cifs.upcall";
in '' keyctl = "${pkgs.keyutils}/bin/keyctl";
#OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM in
# -t is required for DFS share servers... ''
create cifs.spnego * * ${upcall} -t %k #OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM
create dns_resolver * * ${upcall} %k # -t is required for DFS share servers...
# Everything below this point is essentially the default configuration, create cifs.spnego * * ${upcall} -t %k
# modified minimally to work under NixOS. Notably, it provides debug create dns_resolver * * ${upcall} %k
# logging. # Everything below this point is essentially the default configuration,
create user debug:* negate ${keyctl} negate %k 30 %S # modified minimally to work under NixOS. Notably, it provides debug
create user debug:* rejected ${keyctl} reject %k 30 %c %S # logging.
create user debug:* expired ${keyctl} reject %k 30 %c %S create user debug:* negate ${keyctl} negate %k 30 %S
create user debug:* revoked ${keyctl} reject %k 30 %c %S create user debug:* rejected ${keyctl} reject %k 30 %c %S
create user debug:loop:* * |${pkgs.coreutils}/bin/cat create user debug:* expired ${keyctl} reject %k 30 %c %S
create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S create user debug:* revoked ${keyctl} reject %k 30 %c %S
negate * * * ${keyctl} negate %k 30 %S create user debug:loop:* * |${pkgs.coreutils}/bin/cat
''; create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S
negate * * * ${keyctl} negate %k 30 %S
'';
}; };
} }

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
imports = [ imports = [
./desktop-environment.nix ./desktop-environment.nix
@ -8,5 +14,4 @@
./security.nix ./security.nix
./video.nix ./video.nix
]; ];
} }

View file

@ -1,16 +1,29 @@
{ config, pkgs, lib, ... }: {
let mkDefault = lib.mkDefault; config,
in { pkgs,
lib,
...
}:
let
mkDefault = lib.mkDefault;
in
{
environment.systemPackages = with pkgs; environment.systemPackages =
[ # Utilities with pkgs;
[
# Utilities
freetype freetype
feh feh
lxappearance lxappearance
sound-theme-freedesktop sound-theme-freedesktop
] ++ [ # Networking ]
++ [
# Networking
gnome.networkmanager-openconnect gnome.networkmanager-openconnect
] ++ [ # Various ]
++ [
# Various
xfce.thunar xfce.thunar
xfce.thunar-archive-plugin xfce.thunar-archive-plugin
xfce.xfce4-appfinder # xfce.thunar-volman # needed? xfce.xfce4-appfinder # xfce.thunar-volman # needed?
@ -79,5 +92,4 @@ in {
wlr.enable = true; wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
}; };
} }

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
services.xserver.windowManager.i3.enable = true; services.xserver.windowManager.i3.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
@ -44,5 +49,4 @@
programs.light.enable = true; programs.light.enable = true;
programs.adb.enable = true; programs.adb.enable = true;
} }

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
services.pcscd.enable = true; services.pcscd.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
#boot.kernelModules = [ "v4l2loopback" ]; #boot.kernelModules = [ "v4l2loopback" ];

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
let let
thunderboltDevices = '' thunderboltDevices = ''
THUNDERBOLT_DEVICES="$(${pkgs.pciutils}/bin/lspci -D | ${pkgs.gnugrep}/bin/grep -i thunderbolt | cut --delimiter=' ' --fields=1)" THUNDERBOLT_DEVICES="$(${pkgs.pciutils}/bin/lspci -D | ${pkgs.gnugrep}/bin/grep -i thunderbolt | cut --delimiter=' ' --fields=1)"
@ -33,7 +39,8 @@ let
echo 'Done.' echo 'Done.'
''; '';
in { in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
@ -47,7 +54,10 @@ in {
"igb" "igb"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "uhid" ]; boot.kernelModules = [
"kvm-amd"
"uhid"
];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernelParams = [ "acpi_enforce_resources=lax" ]; boot.kernelParams = [ "acpi_enforce_resources=lax" ];
@ -56,6 +66,5 @@ in {
hardware.cpu.amd.updateMicrocode = true; hardware.cpu.amd.updateMicrocode = true;
nix.settings.max-jobs = lib.mkDefault 24; nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.powerUpCommands = powerManagement.powerUpCommands = "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
"${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
} }

View file

@ -1,13 +1,18 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.loader.grub.extraConfig = boot.loader.grub.extraConfig = "\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
"\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"ahci" "ahci"
@ -18,7 +23,11 @@
"sdhci_pci" "sdhci_pci"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "virtio" "tun" ]; boot.kernelModules = [
"kvm-amd"
"virtio"
"tun"
];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernelParams = [ "console=ttyS0,115200n8" ]; boot.kernelParams = [ "console=ttyS0,115200n8" ];

View file

@ -1,3 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }: { {
hardware.rasdaemon = { enable = true; }; config,
lib,
pkgs,
modulesPath,
...
}:
{
hardware.rasdaemon = {
enable = true;
};
} }

View file

@ -1,4 +1,12 @@
{ config, lib, pkgs, modulesPath, hardwareModules, ... }: { {
config,
lib,
pkgs,
modulesPath,
hardwareModules,
...
}:
{
imports = with hardwareModules; [ imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@ -22,8 +30,7 @@
# Ignore Alcor smartcard (gpg is not very smart) # Ignore Alcor smartcard (gpg is not very smart)
# See https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html # See https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html
systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES = systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES = "Alcor";
"Alcor";
#hardware.video.hidpi.enable = true; #hardware.video.hidpi.enable = true;

View file

@ -1,18 +1,36 @@
{ config, lib, pkgs, modulesPath, hardwareModules, pkgFccUnlock, ... }: { {
config,
lib,
pkgs,
modulesPath,
hardwareModules,
pkgFccUnlock,
...
}:
{
imports = with hardwareModules; [ imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
hardwareModules.lenovo-thinkpad-x1-9th-gen hardwareModules.lenovo-thinkpad-x1-9th-gen
]; ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules = [
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "ahci" "usbhid" ]; "xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
"ahci"
"usbhid"
];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.initrd.kernelModules = boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults
[ "dm-snapshot" ]; # TODO: This should be moved to defaults
environment.systemPackages = with pkgs; [ modemmanager libmbim ]; environment.systemPackages = with pkgs; [
modemmanager
libmbim
];
environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = { environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = {
source = "${pkgFccUnlock}/bin/fcc-unlock"; source = "${pkgFccUnlock}/bin/fcc-unlock";

View file

@ -1,9 +1,19 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
services.printing = { services.printing = {
enable = true; enable = true;
drivers = with pkgs; [ gutenprint hplip splix cups-googlecloudprint ]; drivers = with pkgs; [
gutenprint
hplip
splix
cups-googlecloudprint
];
}; };
services.system-config-printer.enable = true; services.system-config-printer.enable = true;

110
flake.nix
View file

@ -15,83 +15,79 @@
url = "git+file:///etc/nixos/fcc-unlock"; url = "git+file:///etc/nixos/fcc-unlock";
inputs.nixos-stable.follows = "nixpkgs-stable"; inputs.nixos-stable.follows = "nixpkgs-stable";
}; };
}; };
outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager outputs =
, nixos-hardware, fcc-unlock, catppuccin, ... }@inputs: {
self,
nixpkgs-unstable,
nixpkgs-stable,
home-manager,
nixos-hardware,
fcc-unlock,
catppuccin,
...
}@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgsUnstable = import nixpkgs-unstable { pkgsUnstable = import nixpkgs-unstable {
inherit system; inherit system;
config.allowUnfree = true; # For vscode config.allowUnfree = true; # For vscode
}; };
hosts = [ "speer" "hummelberg" "ochsenchopf" ]; hosts = [
in { "speer"
checks.${system}.formatCheck = let pkgs = pkgsUnstable; "hummelberg"
in pkgs.runCommand "nixfmt-check" { } '' "ochsenchopf"
set -euo pipefail ];
cd ${self} in
${self.apps.${system}.format.program} --check {
mkdir $out
'';
# Build with `nixos-rebuild --flake .#<hostname>` or # Build with `nixos-rebuild --flake .#<hostname>` or
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel # `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
nixosConfigurations = let nixosConfigurations =
sharedSpecialArgs = { let
inherit pkgsUnstable; sharedSpecialArgs = {
pkgFccUnlock = fcc-unlock.packages.${system}.default; inherit pkgsUnstable;
pkgFccUnlock = fcc-unlock.packages.${system}.default;
};
home-manager-config = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = sharedSpecialArgs;
users.fhauser.imports = [
./home/fhauser/default.nix
catppuccin.homeManagerModules.catppuccin
];
}; };
}; home-manager-config = {
mapHostnameToAttr = host: home-manager = {
nixpkgs-stable.lib.nixosSystem { useGlobalPkgs = true;
inherit system; useUserPackages = true;
specialArgs = sharedSpecialArgs // { extraSpecialArgs = sharedSpecialArgs;
hardwareModules = nixos-hardware.nixosModules; users.fhauser.imports = [
./home/fhauser/default.nix
catppuccin.homeManagerModules.catppuccin
];
}; };
modules = [
home-manager.nixosModules.home-manager
catppuccin.nixosModules.catppuccin
./host/${host}/default.nix
] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]);
}; };
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr; mapHostnameToAttr =
host:
nixpkgs-stable.lib.nixosSystem {
inherit system;
specialArgs = sharedSpecialArgs // {
hardwareModules = nixos-hardware.nixosModules;
};
modules = [
home-manager.nixosModules.home-manager
catppuccin.nixosModules.catppuccin
./host/${host}/default.nix
] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]);
};
in
pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
# Nix development shell # Nix development shell
devShells.${system}.default = import ./shell.nix { pkgs = pkgsUnstable; }; devShells.${system}.default = import ./shell.nix { pkgs = pkgsUnstable; };
# Run checks and build all hosts as default package # Run checks and build all hosts as default package
packages.${system}.default = with pkgsUnstable.lib; packages.${system}.default =
with pkgsUnstable.lib;
let let
checks = attrValues self.checks.${system}; checks = attrValues self.checks.${system};
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel) nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
self.nixosConfigurations; in
in pkgsUnstable.linkFarmFromDrvs "allHosts" (checks ++ nixosConfigs); pkgsUnstable.linkFarmFromDrvs "allHosts" (checks ++ nixosConfigs);
apps.${system} = { formatter.${system} = pkgsUnstable.nixfmt-rfc-style;
# Execute nixfmt on the repository
format = let
pkgs = pkgsUnstable;
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
${pkgs.findutils}/bin/find . -type f -name '*.nix' -exec ${pkgs.nixfmt}/bin/nixfmt $@ {} +
'';
in {
type = "app";
program = "${formatter}/bin/formatter";
};
};
}; };
} }

View file

@ -1,3 +1,4 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
{
catppuccin.flavour = "mocha"; catppuccin.flavour = "mocha";
} }

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
@ -34,15 +39,23 @@
}; };
home = { home = {
sessionVariables = { NIXOS_OZONE_WL = "1"; }; sessionVariables = {
packages = with pkgs; NIXOS_OZONE_WL = "1";
[ # Networking };
packages =
with pkgs;
[
# Networking
transmission # GUI Tools, maybe extract... transmission # GUI Tools, maybe extract...
] ++ [ # Desktop Environment Applications ]
++ [
# Desktop Environment Applications
google-chrome google-chrome
chromium chromium
nextcloud-client nextcloud-client
] ++ [ # office ]
++ [
# office
calibre calibre
libreoffice-fresh # TODO: Dictionaries, nixos/nixpkgs#14430 libreoffice-fresh # TODO: Dictionaries, nixos/nixpkgs#14430
tectonic tectonic
@ -52,14 +65,18 @@
pkgs.gnome-online-accounts pkgs.gnome-online-accounts
gnome.gnome-control-center gnome.gnome-control-center
todoist-electron todoist-electron
] ++ [ # Communication ]
++ [
# Communication
#TODO: ekiga? #TODO: ekiga?
jitsi-meet-electron jitsi-meet-electron
teamviewer teamviewer
rdesktop rdesktop
#davinci-resolve #davinci-resolve
lightworks lightworks
] ++ [ # Development ]
++ [
# Development
vscodium vscodium
virt-manager virt-manager
modemmanager # TODO: makes sense here? modemmanager # TODO: makes sense here?
@ -67,34 +84,33 @@
]; ];
#TODO: Write module #TODO: Write module
activation.statefulConfigSymlinks = activation.statefulConfigSymlinks = config.lib.dag.entryAfter [ "writeBoundary" ] ''
config.lib.dag.entryAfter [ "writeBoundary" ] '' set -eo pipefail
set -eo pipefail
STATEFUL_ROOT="$HOME/.stateful" STATEFUL_ROOT="$HOME/.stateful"
if [ ! -d "$STATEFUL_ROOT" ]; then if [ ! -d "$STATEFUL_ROOT" ]; then
$DRY_RUN_CMD mkdir "$STATEFUL_ROOT" $DRY_RUN_CMD mkdir "$STATEFUL_ROOT"
fi
STATEFUL_CONFS=(
".config/spotify"
".mozilla"
".password-store"
)
for STATEFUL_CONF in ''${STATEFUL_CONFS[@]}; do
if [ -e "$STATEFUL_CONF" ] && [ ! -h "$STATEFUL_CONF" ]; then
echo "File $STATEFUL_CONF already exists, exiting!" >&2
exit 1
fi fi
STATEFUL_CONFS=( if [ -h "$STATEFUL_CONF" ]; then
".config/spotify" $DRY_RUN_CMD rm "$STATEFUL_CONF"
".mozilla" fi
".password-store"
)
for STATEFUL_CONF in ''${STATEFUL_CONFS[@]}; do
if [ -e "$STATEFUL_CONF" ] && [ ! -h "$STATEFUL_CONF" ]; then
echo "File $STATEFUL_CONF already exists, exiting!" >&2
exit 1
fi
if [ -h "$STATEFUL_CONF" ]; then STATEFUL_CONF_DIR="$STATEFUL_ROOT/$STATEFUL_CONF"
$DRY_RUN_CMD rm "$STATEFUL_CONF" $DRY_RUN_CMD mkdir -p "$STATEFUL_CONF_DIR"
fi $DRY_RUN_CMD ln -s $VERBOSE_ARG "$STATEFUL_CONF_DIR" "$HOME/$STATEFUL_CONF"
done
STATEFUL_CONF_DIR="$STATEFUL_ROOT/$STATEFUL_CONF" '';
$DRY_RUN_CMD mkdir -p "$STATEFUL_CONF_DIR"
$DRY_RUN_CMD ln -s $VERBOSE_ARG "$STATEFUL_CONF_DIR" "$HOME/$STATEFUL_CONF"
done
'';
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { { pkgs, ... }:
dconf.settings."org/gnome/evolution-data-server/calendar".notify-enable-audio = {
false; dconf.settings."org/gnome/evolution-data-server/calendar".notify-enable-audio = false;
} }

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox; package = pkgs.firefox;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
services.gammastep = { services.gammastep = {
enable = true; enable = true;
settings.general.brightness-night = "0.9"; settings.general.brightness-night = "0.9";

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;
@ -6,8 +7,7 @@
s = "status --short --branch"; s = "status --short --branch";
a = "add --patch"; a = "add --patch";
c = "commit --message"; c = "commit --message";
l = l = "log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset (S: %G?)' --abbrev-commit";
"log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset (S: %G?)' --abbrev-commit";
d = "diff"; d = "diff";
fup = "commit --fixup"; fup = "commit --fixup";
@ -57,26 +57,34 @@
rerere.enabled = true; rerere.enabled = true;
fetch.recurseSubmodules = "on-demand"; fetch.recurseSubmodules = "on-demand";
}; };
ignores = [ "*~" "*.swp" ".direnv/" ]; ignores = [
lfs.enable = true; "*~"
includes = let "*.swp"
mkConfig = (dir: { ".direnv/"
condition = "gitdir:${dir}";
contents = {
user = {
signingkey = "0x8A52A140BEBF7D2C";
email = "fabian@fh2.ch";
name = "Fabian Hauser";
};
};
});
in map mkConfig [
"~/private/"
"/etc/nixos/"
"~/.password-store/"
"~/.stateful/"
"~/shares/cloud.qo.is/"
"~/shares/drive.switch.ch/"
]; ];
lfs.enable = true;
includes =
let
mkConfig = (
dir: {
condition = "gitdir:${dir}";
contents = {
user = {
signingkey = "0x8A52A140BEBF7D2C";
email = "fabian@fh2.ch";
name = "Fabian Hauser";
};
};
}
);
in
map mkConfig [
"~/private/"
"/etc/nixos/"
"~/.password-store/"
"~/.stateful/"
"~/shares/cloud.qo.is/"
"~/shares/drive.switch.ch/"
];
}; };
} }

View file

@ -1,4 +1,5 @@
{ pkgs, pkgsUnstable, ... }: { { pkgs, pkgsUnstable, ... }:
{
#TODO: ENV variabls for agent #TODO: ENV variabls for agent
programs.gpg = { programs.gpg = {
enable = true; enable = true;
@ -14,8 +15,7 @@
"personal-cipher-preferences" = "AES256 AES192 AES CAST5"; "personal-cipher-preferences" = "AES256 AES192 AES CAST5";
"cert-digest-algo" = "SHA512"; "cert-digest-algo" = "SHA512";
"personal-digest-preferences" = "SHA512 SHA384 SHA256 SHA224"; "personal-digest-preferences" = "SHA512 SHA384 SHA256 SHA224";
"default-preference-list" = "default-preference-list" = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
"SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
"display-charset" = "utf-8"; "display-charset" = "utf-8";
"fixed-list-mode" = true; "fixed-list-mode" = true;
"with-fingerprint" = true; "with-fingerprint" = true;
@ -23,7 +23,9 @@
"verify-options" = "show-uid-validity"; "verify-options" = "show-uid-validity";
"list-options" = "show-uid-validity"; "list-options" = "show-uid-validity";
}; };
scdaemonSettings = { disable-ccid = true; }; scdaemonSettings = {
disable-ccid = true;
};
# TODO: Complete this list and maybe transfer to managed configuration? # TODO: Complete this list and maybe transfer to managed configuration?
#publicKeys = [ #publicKeys = [
# { source = "./fabian.hauser@qo.is.pub"; trust = 5; } # { source = "./fabian.hauser@qo.is.pub"; trust = 5; }
@ -36,17 +38,19 @@
enableSshSupport = true; enableSshSupport = true;
enableExtraSocket = true; enableExtraSocket = true;
# TODO: pinentryPackage = # TODO: pinentryPackage =
extraConfig = let extraConfig =
pinentryBemenu = pkgs.writeShellApplication { let
name = "pinentry-bemenu-with-env"; pinentryBemenu = pkgs.writeShellApplication {
text = '' name = "pinentry-bemenu-with-env";
PATH="$PATH:${pkgs.coreutils}/bin:${pkgs.bemenu}/bin" text = ''
"${pkgs.pinentry-bemenu}/bin/pinentry-bemenu" "$@" PATH="$PATH:${pkgs.coreutils}/bin:${pkgs.bemenu}/bin"
''; "${pkgs.pinentry-bemenu}/bin/pinentry-bemenu" "$@"
}; '';
in '' };
pinentry-program ${pinentryBemenu}/bin/pinentry-bemenu-with-env in
''; ''
pinentry-program ${pinentryBemenu}/bin/pinentry-bemenu-with-env
'';
sshKeys = [ sshKeys = [
"99DFB0F28CF9420A2D6383139E86814A1568C81B" # 0x8193A5D218B553DD / fabian.hauser@threema.ch "99DFB0F28CF9420A2D6383139E86814A1568C81B" # 0x8193A5D218B553DD / fabian.hauser@threema.ch
"638143D3F6421377E9D4C7F1D2EDC5AA0A860351" # 0x3E957C9C8CB5D6B2 / fabian.hauser@qo.is "638143D3F6421377E9D4C7F1D2EDC5AA0A860351" # 0x3E957C9C8CB5D6B2 / fabian.hauser@qo.is

View file

@ -1,77 +1,109 @@
{ pkgs, lib, config, ... }: { {
pkgs,
lib,
config,
...
}:
{
# systemd.user.services.kanshi.Install.WantedBy = "home-manager-fhauser.service"; # TODO: Upstream array type of systemdTarget # systemd.user.services.kanshi.Install.WantedBy = "home-manager-fhauser.service"; # TODO: Upstream array type of systemdTarget
services.kanshi = { services.kanshi = {
enable = true; enable = true;
profiles = let profiles =
backgroundPicturePath = "~/pictures/backgrounds"; let
backgroundCommand = '' backgroundPicturePath = "~/pictures/backgrounds";
#swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill" backgroundCommand = ''
''; #swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"
mkScreen = (screen: { '';
criteria = screen; mkScreen = (
status = "enable"; screen: {
scale = 1.0; criteria = screen;
}); status = "enable";
homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53"; scale = 1.0;
p14sScreen = "BOE 0x08CE Unknown"; }
in rec { );
#mobile-work.exec = backgroundCommand; homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53";
mobile-work.outputs = [ p14sScreen = "BOE 0x08CE Unknown";
(mkScreen p14sScreen // { in
position = "0,0"; rec {
scale = 2.0; #mobile-work.exec = backgroundCommand;
}) mobile-work.outputs = [
]; (
mobile-work-external.outputs = [ mkScreen p14sScreen
(mkScreen p14sScreen // { // {
position = "1920,0"; position = "0,0";
scale = 2.0; scale = 2.0;
}) }
(mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; }) )
]; ];
mobile-private.outputs = [ mobile-work-external.outputs = [
(mkScreen "Unknown 0x1536 0x00000000" // { (
position = "0,0"; mkScreen p14sScreen
scale = 1.5; // {
}) position = "1920,0";
]; scale = 2.0;
home-dock.outputs = mobile-work.outputs ++ [ }
(mkScreen homeDellScreen // { )
position = "1920,0"; (mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; })
scale = 1.0; ];
status = "enable"; mobile-private.outputs = [
}) (
]; mkScreen "Unknown 0x1536 0x00000000"
office-dock.outputs = [ // {
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; }) position = "0,0";
(mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; }) scale = 1.5;
(mkScreen p14sScreen // { }
position = "5120,0"; )
scale = 2.0; ];
}) home-dock.outputs = mobile-work.outputs ++ [
]; (
office-cyrille-dock.outputs = [ mkScreen homeDellScreen
(mkScreen "Acer Technologies Acer PE270K 0x0000B784" // { // {
position = "0,0"; position = "1920,0";
scale = 1.5; scale = 1.0;
}) status = "enable";
(mkScreen p14sScreen // { }
position = "2560,0"; )
scale = 2.0; ];
}) office-dock.outputs = [
]; (mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; })
home-pc.outputs = [ (mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; })
(mkScreen homeDellScreen // { position = "0,0"; }) (
(mkScreen "HP Inc. HP Z27 CN482201RP" // { mkScreen p14sScreen
position = "2560,0"; // {
scale = 1.5; position = "5120,0";
}) scale = 2.0;
]; }
home-pc-row.outputs = home-pc.outputs ++ [ )
(mkScreen "Eizo Nanao Corporation EV2450 92395086" // { ];
position = "5120,0"; office-cyrille-dock.outputs = [
}) (
]; mkScreen "Acer Technologies Acer PE270K 0x0000B784"
}; // {
position = "0,0";
scale = 1.5;
}
)
(
mkScreen p14sScreen
// {
position = "2560,0";
scale = 2.0;
}
)
];
home-pc.outputs = [
(mkScreen homeDellScreen // { position = "0,0"; })
(
mkScreen "HP Inc. HP Z27 CN482201RP"
// {
position = "2560,0";
scale = 1.5;
}
)
];
home-pc-row.outputs = home-pc.outputs ++ [
(mkScreen "Eizo Nanao Corporation EV2450 92395086" // { position = "5120,0"; })
];
};
}; };
} }

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
catppuccin.enable = true; catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
services.mako = { services.mako = {
enable = true; enable = true;
catppuccin.enable = true; catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
home.file.".psqlrc".text = '' home.file.".psqlrc".text = ''
\set QUIET 1 \set QUIET 1
@ -17,5 +18,4 @@
\unset QUIET \unset QUIET
\conninfo \conninfo
''; '';
} }

View file

@ -30,4 +30,10 @@ let
password_value=$(${pkgs.pass-wayland}/bin/pass show "$password" | tail -1 2>/dev/null) password_value=$(${pkgs.pass-wayland}/bin/pass show "$password" | tail -1 2>/dev/null)
${pkgs.wtype}/bin/wtype "''${password_value}" ${pkgs.wtype}/bin/wtype "''${password_value}"
''; '';
in { home.packages = [ passbemenu suspend ]; } in
{
home.packages = [
passbemenu
suspend
];
}

View file

@ -1,8 +1,14 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs = { programs = {
bash = { bash = {
enable = true; enable = true;
historyIgnore = [ "ls" "cd" "exit" "j" ]; historyIgnore = [
"ls"
"cd"
"exit"
"j"
];
shellAliases = { shellAliases = {
# Sane defaults # Sane defaults
l = "ls -lah"; l = "ls -lah";
@ -14,13 +20,10 @@
ack = "rg"; ack = "rg";
# Git helpers # Git helpers
git-fetch-pr = git-fetch-pr = "git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'";
"git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'"; git-config-fetchall = ''git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"'';
git-config-fetchall = ''
git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"'';
git-enable-signing = git-enable-signing = "git config commit.gpgsign true && git config tag.gpgsign true";
"git config commit.gpgsign true && git config tag.gpgsign true";
# Common Typos # Common Typos
gits = "git s"; gits = "git s";
}; };
@ -29,7 +32,13 @@
xdg-open "$*" >/dev/null 2>&1 & xdg-open "$*" >/dev/null 2>&1 &
} }
''; '';
shellOptions = [ "autocd" "checkjobs" "dotglob" "globstar" "histappend" ]; shellOptions = [
"autocd"
"checkjobs"
"dotglob"
"globstar"
"histappend"
];
sessionVariables = { sessionVariables = {
#TODO: Some of these should be migrated to the according application. #TODO: Some of these should be migrated to the according application.
GPG_TTY = "$(tty)"; GPG_TTY = "$(tty)";

View file

@ -1,29 +1,38 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
programs.ssh = let {
forceIdentityThreema = { programs.ssh =
identityFile = toString (pkgs.writeText "fabian.hauser@threema.ch.pub" '' let
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7h492sXT7zdamf+nbOt+y6jiqxicOnm6+wiuEG1EvZ openpgp:0x18B553DD forceIdentityThreema = {
''); identityFile = toString (
identitiesOnly = true; pkgs.writeText "fabian.hauser@threema.ch.pub" ''
}; ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7h492sXT7zdamf+nbOt+y6jiqxicOnm6+wiuEG1EvZ openpgp:0x18B553DD
forceIdentityPrivate = { ''
identityFile = toString (pkgs.writeText "fabian.hauser@qo.is.pub" '' );
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000610954665 identitiesOnly = true;
'');
identitiesOnly = true;
};
in {
enable = true;
matchBlocks = {
"work.github.com" = forceIdentityThreema // {
hostname = "github.com";
user = "git";
}; };
"github.com" = forceIdentityPrivate // { user = "git"; }; forceIdentityPrivate = {
identityFile = toString (
pkgs.writeText "fabian.hauser@qo.is.pub" ''
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000610954665
''
);
identitiesOnly = true;
};
in
{
enable = true;
matchBlocks = {
"work.github.com" = forceIdentityThreema // {
hostname = "github.com";
user = "git";
};
"github.com" = forceIdentityPrivate // {
user = "git";
};
};
extraConfig = ''
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh
'';
#TODO: Authorized keys implementation, see https://github.com/nix-community/home-manager/pull/9
}; };
extraConfig = ''
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh
'';
#TODO: Authorized keys implementation, see https://github.com/nix-community/home-manager/pull/9
};
} }

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
adhereTheSwayTarget = { adhereTheSwayTarget = {
Install.WantedBy = lib.mkForce [ "sway-session.target" ]; Install.WantedBy = lib.mkForce [ "sway-session.target" ];
@ -13,7 +18,8 @@ let
${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Start: ' | \ ${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Start: ' | \
xargs swaymsg exec -- xargs swaymsg exec --
''; '';
in rec { in
rec {
home.packages = with pkgs; [ home.packages = with pkgs; [
sway-contrib.grimshot sway-contrib.grimshot
wl-clipboard wl-clipboard
@ -30,7 +36,9 @@ in rec {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
xwayland = true; xwayland = true;
wrapperFeatures = { gtk = true; }; wrapperFeatures = {
gtk = true;
};
catppuccin.enable = true; catppuccin.enable = true;
extraSessionCommands = '' extraSessionCommands = ''
#export XDG_CURRENT_DESKTOP=Unity #export XDG_CURRENT_DESKTOP=Unity
@ -49,7 +57,9 @@ in rec {
xkb_layout = "ch,de"; xkb_layout = "ch,de";
xkb_options = "eurosign:e"; xkb_options = "eurosign:e";
}; };
"*" = { xkb_numlock = "enable"; }; "*" = {
xkb_numlock = "enable";
};
}; };
terminal = "${pkgs.kitty}/bin/kitty"; terminal = "${pkgs.kitty}/bin/kitty";
menu = "${bemenuLauncher}/bin/bemenuLauncher"; menu = "${bemenuLauncher}/bin/bemenuLauncher";
@ -60,66 +70,66 @@ in rec {
#TODO: Workspace Programm assignment: Not working properly #TODO: Workspace Programm assignment: Not working properly
assigns = { assigns = {
"10" = [{ app_id = "^firefox$"; }]; "10" = [ { app_id = "^firefox$"; } ];
"11" = [{ app_id = "^(claws-mail|thunderbird|evolution)$"; }]; "11" = [ { app_id = "^(claws-mail|thunderbird|evolution)$"; } ];
"12" = [{ "12" = [
class = "^Chromium-browser$"; {
instance = "^web.threema.ch"; class = "^Chromium-browser$";
}]; instance = "^web.threema.ch";
"13" = [{ class = "^Spotify$"; }]; }
];
"13" = [ { class = "^Spotify$"; } ];
}; };
keybindings = let keybindings =
mod = wayland.windowManager.sway.config.modifier; let
playerctl = "${pkgs.playerctl}/bin/playerctl"; mod = wayland.windowManager.sway.config.modifier;
wpctl = "${pkgs.wireplumber}/bin/wpctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
light = "${pkgs.light}/bin/light"; wpctl = "${pkgs.wireplumber}/bin/wpctl";
in lib.mkOptionDefault { light = "${pkgs.light}/bin/light";
"${mod}+p" = "exec passbemenu"; in
"${mod}+Shift+d" = lib.mkOptionDefault {
"exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel"; "${mod}+p" = "exec passbemenu";
"${mod}+x" = "move workspace to output right"; "${mod}+Shift+d" = "exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel";
"${mod}+y" = "move workspace to output left"; "${mod}+x" = "move workspace to output right";
"${mod}+y" = "move workspace to output left";
"${mod}+section" = "workspace 0"; "${mod}+section" = "workspace 0";
"${mod}+0" = "workspace 10"; "${mod}+0" = "workspace 10";
"${mod}+apostrophe" = "workspace 11"; "${mod}+apostrophe" = "workspace 11";
"${mod}+dead_circumflex" = "workspace 12"; "${mod}+dead_circumflex" = "workspace 12";
"${mod}+dead_diaeresis" = "workspace 13"; "${mod}+dead_diaeresis" = "workspace 13";
"${mod}+dollar" = "workspace 14"; "${mod}+dollar" = "workspace 14";
"${mod}+Shift+section" = "move container to workspace 0"; "${mod}+Shift+section" = "move container to workspace 0";
"${mod}+Shift+0" = "move container to workspace 10"; "${mod}+Shift+0" = "move container to workspace 10";
"${mod}+Shift+apostrophe" = "move container to workspace 11"; "${mod}+Shift+apostrophe" = "move container to workspace 11";
"${mod}+Shift+dead_circumflex" = "move container to workspace 12"; "${mod}+Shift+dead_circumflex" = "move container to workspace 12";
"${mod}+Shift+dead_diaeresis" = "move container to workspace 13"; "${mod}+Shift+dead_diaeresis" = "move container to workspace 13";
"${mod}+Shift+dollar" = "move container to workspace 14"; "${mod}+Shift+dollar" = "move container to workspace 14";
"Ctrl+mod1+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session"; "Ctrl+mod1+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session";
"Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend"; "Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend";
# pulse audio volume control # pulse audio volume control
XF86AudioLowerVolume = XF86AudioLowerVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%-";
"exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%-"; XF86AudioRaiseVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%+";
XF86AudioRaiseVolume = XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
"exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%+"; XF86AudioMicMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
XF86AudioMicMute =
"exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
# Spotify control # Spotify control
XF86AudioPause = "exec ${playerctl} play-pause"; XF86AudioPause = "exec ${playerctl} play-pause";
XF86AudioPlay = "exec ${playerctl} play-pause"; XF86AudioPlay = "exec ${playerctl} play-pause";
XF86AudioNext = "exec ${playerctl} next"; XF86AudioNext = "exec ${playerctl} next";
XF86AudioPrev = "exec ${playerctl} previous"; XF86AudioPrev = "exec ${playerctl} previous";
# screen brightness # screen brightness
XF86MonBrightnessUp = "exec ${light} -A 10"; XF86MonBrightnessUp = "exec ${light} -A 10";
XF86MonBrightnessDown = "exec ${light} -U 5"; XF86MonBrightnessDown = "exec ${light} -U 5";
# screenshot # screenshot
Print = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; Print = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
}; };
}; };
extraConfig = '' extraConfig = ''
# Disable the laptop screen when the lid is closed. # Disable the laptop screen when the lid is closed.
@ -137,8 +147,7 @@ in rec {
Unit.After = lib.mkForce [ "waybar.service" ]; Unit.After = lib.mkForce [ "waybar.service" ];
Service = { Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3"; ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
Environment = lib.mkForce Environment = lib.mkForce "PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
"PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
}; };
}; };
systemd.user.services.owncloud-client = adhereTheSwayTarget // { systemd.user.services.owncloud-client = adhereTheSwayTarget // {
@ -146,8 +155,7 @@ in rec {
Unit.After = lib.mkForce [ "waybar.service" ]; Unit.After = lib.mkForce [ "waybar.service" ];
Service = { Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3"; ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
Environment = lib.mkForce Environment = lib.mkForce "PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
"PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
}; };
}; };
systemd.user.services.pasystray = adhereTheSwayTarget; systemd.user.services.pasystray = adhereTheSwayTarget;
@ -163,5 +171,7 @@ in rec {
catppuccin.enable = true; catppuccin.enable = true;
}; };
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; }; dconf.settings = {
"org/gnome/desktop/interface".menus-have-icons = true;
};
} }

View file

@ -1,35 +1,36 @@
{ pkgs, ... }: { { pkgs, ... }:
systemd.user.services.swayidle = let {
lock = systemd.user.services.swayidle =
"${pkgs.swaylock}/bin/swaylock --hide-keyboard-layout --ignore-empty-password --daemonize --show-failed-attempts --color=000000"; let
logTimeCmd = "${pkgs.coreutils}/bin/date --rfc-3339=seconds >> ~/locklog"; lock = "${pkgs.swaylock}/bin/swaylock --hide-keyboard-layout --ignore-empty-password --daemonize --show-failed-attempts --color=000000";
idleCmd = (action: logTimeCmd = "${pkgs.coreutils}/bin/date --rfc-3339=seconds >> ~/locklog";
''${pkgs.sway}/bin/swaymsg "output * dpms ${action}" && ${logTimeCmd}''); idleCmd = (action: ''${pkgs.sway}/bin/swaymsg "output * dpms ${action}" && ${logTimeCmd}'');
timeout-screens-off = 600; timeout-screens-off = 600;
timeout-lock = 630; timeout-lock = 630;
timeout-suspend = 1800; timeout-suspend = 1800;
in { in
Unit = { {
Description = "Idle Manager for Wayland"; Unit = {
Documentation = [ "man:swayidle(1)" ]; Description = "Idle Manager for Wayland";
PartOf = [ "graphical-session.target" ]; Documentation = [ "man:swayidle(1)" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Environment = "PATH=${pkgs.bash}/bin";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w -d \
timeout ${toString timeout-lock} '${lock}' \
timeout ${toString timeout-screens-off} '${idleCmd "off"}' \
resume '${idleCmd "on"}' \
timeout ${toString timeout-suspend} '${pkgs.systemd}/bin/systemctl suspend' \
lock '${lock}' \
before-sleep '${lock}';
''; # TODO: Make this configurable and add home-manager module. (Requires sway with systemd-target support)
};
Install = {
WantedBy = [ "sway-session.target" ];
};
}; };
Service = {
Environment = "PATH=${pkgs.bash}/bin";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w -d \
timeout ${toString timeout-lock} '${lock}' \
timeout ${toString timeout-screens-off} '${idleCmd "off"}' \
resume '${idleCmd "on"}' \
timeout ${
toString timeout-suspend
} '${pkgs.systemd}/bin/systemctl suspend' \
lock '${lock}' \
before-sleep '${lock}';
''; # TODO: Make this configurable and add home-manager module. (Requires sway with systemd-target support)
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
programs.swaylock.catppuccin.enable = true; programs.swaylock.catppuccin.enable = true;
} }

View file

@ -1,7 +1,8 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
@ -50,6 +51,9 @@
filetype plugin indent on filetype plugin indent on
syntax on syntax on
''; '';
plugins = with pkgs.vimPlugins; [ vim-sensible vim-airline ]; plugins = with pkgs.vimPlugins; [
vim-sensible
vim-airline
];
}; };
} }

View file

@ -1,4 +1,10 @@
{ pkgs, lib, config, ... }: { {
pkgs,
lib,
config,
...
}:
{
xsession.preferStatusNotifierItems = true; xsession.preferStatusNotifierItems = true;
wayland.windowManager.sway.config.bars = [ ]; wayland.windowManager.sway.config.bars = [ ];
@ -8,118 +14,126 @@
enable = true; enable = true;
target = "tray.target"; target = "tray.target";
}; };
settings = [{ settings = [
position = "top"; {
#height = position = "top";
modules-left = [ "sway/mode" "sway/workspaces" ]; #height =
modules-center = [ "sway/window" ]; modules-left = [
modules-right = [ "sway/mode"
"idle_inhibitor" "sway/workspaces"
"backlight"
"battery"
"pulseaudio"
"tray"
"clock"
];
backlight.format = " {percent}%";
disk.format = " {percentage_used}%";
clock.format = "{:%Y-%m-%d%H:%M}";
"sway/workspaces" = {
disable-scroll-wraparound = true;
enable-bar-scroll = true;
numeric-first = true;
};
battery = {
interval = 60;
states = {
warning = 15;
critical = 10;
};
format = " {capacity}% {time}"; # Icon: bolt
format-discharging = "{icon} {capacity}% {time}";
format-time = "{H}:{M}";
format-icons = [
"" # Icon: battery-full
"" # Icon: battery-three-quarters
"" # Icon: battery-half
"" # Icon: battery-quarter
"" # Icon: battery-empty
]; ];
tooltip = "true"; modules-center = [ "sway/window" ];
}; modules-right = [
"idle_inhibitor"
cpu = { "backlight"
interval = "5"; "battery"
format = " {usage}% ({load})"; # Icon: microchip "pulseaudio"
states = { "tray"
warning = "70"; "clock"
critical = "90"; ];
backlight.format = " {percent}%";
disk.format = " {percentage_used}%";
clock.format = "{:%Y-%m-%d%H:%M}";
"sway/workspaces" = {
disable-scroll-wraparound = true;
enable-bar-scroll = true;
numeric-first = true;
}; };
};
memory = { battery = {
interval = "5"; interval = 60;
format = " {}%"; # Icon: microchip states = {
states = { warning = 15;
warning = "70"; critical = 10;
critical = "90"; };
format = " {capacity}% {time}"; # Icon: bolt
format-discharging = "{icon} {capacity}% {time}";
format-time = "{H}:{M}";
format-icons = [
"" # Icon: battery-full
"" # Icon: battery-three-quarters
"" # Icon: battery-half
"" # Icon: battery-quarter
"" # Icon: battery-empty
];
tooltip = "true";
}; };
};
"sway/mode" = { cpu = {
format = interval = "5";
''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt format = " {usage}% ({load})"; # Icon: microchip
tooltip = "false"; states = {
}; warning = "70";
critical = "90";
"sway/window" = { };
format = "{}";
max-length = "120";
};
"sway/workspaces" = {
all-outputs = false;
disable-scroll = true;
format = "{icon}";
format-icons = {
"10" = " 10";
"11" = " 11";
"12" = " 12";
"13" = " 13";
}; };
};
pulseaudio = { memory = {
scroll-step = 3; interval = "5";
format = "{icon} {volume}%"; format = " {}%"; # Icon: microchip
format-bluetooth = "{icon} {volume}%"; states = {
format-muted = "🔇"; warning = "70";
format-icons = { critical = "90";
headphones = ""; };
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
}; };
on-click = "pavucontrol";
};
idle_inhibitor = { "sway/mode" = {
format = "{icon}"; format = ''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt
format-icons = { tooltip = "false";
activated = " active";
deactivated = "";
}; };
};
tray = { "sway/window" = {
icon-size = "21"; format = "{}";
spacing = "10"; max-length = "120";
}; };
}];
"sway/workspaces" = {
all-outputs = false;
disable-scroll = true;
format = "{icon}";
format-icons = {
"10" = " 10";
"11" = " 11";
"12" = " 12";
"13" = " 13";
};
};
pulseaudio = {
scroll-step = 3;
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "🔇";
format-icons = {
headphones = "";
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [
""
""
""
];
};
on-click = "pavucontrol";
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = " active";
deactivated = "";
};
};
tray = {
icon-size = "21";
spacing = "10";
};
}
];
style = '' style = ''
/* ============================================================================= /* =============================================================================

View file

@ -1,7 +1,8 @@
{ pkgs, ... }: { pkgs, ... }:
let let
web-app = name: url: web-app =
name: url:
pkgs.writeScriptBin name '' pkgs.writeScriptBin name ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
exec ${pkgs.chromium}/bin/chromium --user-data-dir=$HOME/.config/chromium-app-${name} --app="${url}" exec ${pkgs.chromium}/bin/chromium --user-data-dir=$HOME/.config/chromium-app-${name} --app="${url}"
@ -11,6 +12,13 @@ let
threema-work = web-app "threema-work" "https://web-beta.threema.ch/"; threema-work = web-app "threema-work" "https://web-beta.threema.ch/";
threema-red = web-app "threema-red" "https://web-work-staging.threema.ch/"; threema-red = web-app "threema-red" "https://web-work-staging.threema.ch/";
threema-tickets = web-app "threema-tickets" "https://ticket.threema.ch/scp/"; threema-tickets = web-app "threema-tickets" "https://ticket.threema.ch/scp/";
in { in
home.packages = [ whatsapp threema threema-work threema-red threema-tickets ]; {
home.packages = [
whatsapp
threema
threema-work
threema-red
threema-tickets
];
} }

View file

@ -1,4 +1,11 @@
{ config, pkgs, lib, nixosConfig, ... }: { {
config,
pkgs,
lib,
nixosConfig,
...
}:
{
imports = [ imports = [
./multimedia.nix ./multimedia.nix
./applications ./applications

View file

@ -1,9 +1,24 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
home.packages = with pkgs; home.packages =
[ neverball wesnoth pingus superTux superTuxKart extremetuxracer zeroad ] with pkgs;
++ (with pkgs.gnome; [ # Selection of gnome games [
neverball
wesnoth
pingus
superTux
superTuxKart
extremetuxracer
zeroad
]
++ (with pkgs.gnome; [
# Selection of gnome games
five-or-more five-or-more
four-in-a-row four-in-a-row
gnome-chess gnome-chess

View file

@ -1,64 +1,72 @@
{ pkgs, lib, config, ... }: { {
pkgs,
lib,
config,
...
}:
{
xdg.mimeApps = rec { xdg.mimeApps = rec {
enable = true; enable = true;
associations.added = defaultApplications; associations.added = defaultApplications;
defaultApplications = let defaultApplications =
browser = [ "firefox.desktop" ]; let
email = [ "org.gnome.Evolution.desktop" ]; browser = [ "firefox.desktop" ];
doc-editor = [ "writer.desktop" ]; email = [ "org.gnome.Evolution.desktop" ];
sheet-editor = [ "calc.desktop" ]; doc-editor = [ "writer.desktop" ];
presentation-editor = [ "impress.desktop" ]; sheet-editor = [ "calc.desktop" ];
pdf = [ "org.gnome.Evince.desktop" ]; presentation-editor = [ "impress.desktop" ];
image = [ "org.gnome.Loupe.desktop" "gimp.desktop" ]; pdf = [ "org.gnome.Evince.desktop" ];
image-vector = [ "org.inkscape.Inkscape.desktop" ]; image = [
ebooks = [ "calibre-ebook-viewer.desktop" ]; "org.gnome.Loupe.desktop"
code-general = [ "codium.desktop" ]; "gimp.desktop"
video = [ "mpv.desktop" ]; ];
compression = [ "org.gnome.Nautilus.desktop" ]; image-vector = [ "org.inkscape.Inkscape.desktop" ];
in { ebooks = [ "calibre-ebook-viewer.desktop" ];
"text/html" = browser; code-general = [ "codium.desktop" ];
"x-scheme-handler/http" = browser; video = [ "mpv.desktop" ];
"x-scheme-handler/https" = browser; compression = [ "org.gnome.Nautilus.desktop" ];
"x-scheme-handler/chrome" = browser; in
"application/xhtml+xml" = browser; {
"application/x-extension-htm" = browser; "text/html" = browser;
"application/x-extension-html" = browser; "x-scheme-handler/http" = browser;
"application/x-extension-shtml" = browser; "x-scheme-handler/https" = browser;
"application/x-extension-xhtml" = browser; "x-scheme-handler/chrome" = browser;
"application/x-extension-xht" = browser; "application/xhtml+xml" = browser;
"x-scheme-handler/mailto" = email; "application/x-extension-htm" = browser;
"text/calendar" = email; "application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"x-scheme-handler/mailto" = email;
"text/calendar" = email;
"application/vnd.oasis.opendocument.text" = doc-editor; "application/vnd.oasis.opendocument.text" = doc-editor;
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = doc-editor;
doc-editor; "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = sheet-editor;
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "application/vnd.openxmlformats-officedocument.presentationml.presentation" = presentation-editor;
sheet-editor; "application/vnd.oasis.opendocument.presentation" = presentation-editor;
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "application/pdf" = pdf;
presentation-editor; "application/x-extension-pdf" = pdf;
"application/vnd.oasis.opendocument.presentation" = presentation-editor; "application/epub+zip" = ebooks;
"application/pdf" = pdf;
"application/x-extension-pdf" = pdf;
"application/epub+zip" = ebooks;
"text/plain" = code-general; "text/plain" = code-general;
"application/json" = code-general; "application/json" = code-general;
"text/markdown" = code-general; "text/markdown" = code-general;
"image/png" = image; "image/png" = image;
"image/jpg" = image; "image/jpg" = image;
"image/jpeg" = image; "image/jpeg" = image;
"image/x-tga" = image; "image/x-tga" = image;
"image/tiff" = image; "image/tiff" = image;
"image/x-canon-cr2" = image; "image/x-canon-cr2" = image;
"application/x-ptoptimizer-script" = [ "hugin.desktop" ]; "application/x-ptoptimizer-script" = [ "hugin.desktop" ];
"image/svg+xml" = image-vector; "image/svg+xml" = image-vector;
"video/mp4" = video; "video/mp4" = video;
"video/x-matroska" = video; "video/x-matroska" = video;
"application/zip" = compression; "application/zip" = compression;
}; };
}; };
} }

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
@ -12,8 +17,16 @@
profile = "gpu-hq"; profile = "gpu-hq";
}; };
}; };
home.packages = with pkgs; home.packages =
[ vlc v4l-utils playerctl yt-dlp ] ++ [ # Audio with pkgs;
[
vlc
v4l-utils
playerctl
yt-dlp
]
++ [
# Audio
gnome.gnome-sound-recorder gnome.gnome-sound-recorder
enblend-enfuse enblend-enfuse
ffmpeg ffmpeg
@ -29,7 +42,9 @@
pasystray pasystray
pavucontrol pavucontrol
spotify spotify
] ++ [ # Imaging ]
++ [
# Imaging
gimp gimp
hugin hugin
lensfun lensfun
@ -39,7 +54,9 @@
# ImageMagick-perl perl-File-Type perl-Term-ProgressBar #TODO: Support libraries for scripts # ImageMagick-perl perl-File-Type perl-Term-ProgressBar #TODO: Support libraries for scripts
inkscape inkscape
ghostscript ghostscript
] ++ [ # Codecs for Audio and Video ]
++ [
# Codecs for Audio and Video
vobcopy vobcopy
libdv libdv
libdvbpsi # TODO: librtmp? libdvbpsi # TODO: librtmp?
@ -54,5 +71,4 @@
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-ugly gst_all_1.gst-plugins-ugly
]; ];
} }

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
imports = [ imports = [
./filesystems.nix ./filesystems.nix
@ -16,7 +17,8 @@
#TODO: Clean up next section #TODO: Clean up next section
services.xserver.dpi = 180; services.xserver.dpi = 180;
virtualisation = { # TODO: This should probably be somewhere else. virtualisation = {
# TODO: This should probably be somewhere else.
docker = { docker = {
enable = true; enable = true;
enableOnBoot = false; enableOnBoot = false;

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
boot.initrd.luks.devices = { boot.initrd.luks.devices = {
"root".device = "/dev/disk/by-uuid/fae1b81e-894c-47b4-92e5-0a817fd6f66f"; "root".device = "/dev/disk/by-uuid/fae1b81e-894c-47b4-92e5-0a817fd6f66f";
"swap".device = "/dev/disk/by-uuid/dc1fe9ff-7eb7-40c3-8fbd-d99398e5e5d6"; "swap".device = "/dev/disk/by-uuid/dc1fe9ff-7eb7-40c3-8fbd-d99398e5e5d6";
@ -21,10 +27,9 @@
}; };
}; };
swapDevices = [{ device = "/dev/mapper/swap"; }]; swapDevices = [ { device = "/dev/mapper/swap"; } ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -2,15 +2,17 @@
{ {
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261"; hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{ hardware.printers.ensurePrinters = [
name = "hsr-mfp-8261"; {
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp"; name = "hsr-mfp-8261";
location = "HSR 8.261"; deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
model = "HP/hp-color_laserjet_mfp_m577-ps.ppd.gz"; location = "HSR 8.261";
ppdOptions = { model = "HP/hp-color_laserjet_mfp_m577-ps.ppd.gz";
Duplex = "DuplexNoTumble"; ppdOptions = {
PageSize = "A4"; Duplex = "DuplexNoTumble";
auth-info-required = "username,password"; PageSize = "A4";
}; auth-info-required = "username,password";
}]; };
}
];
} }

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
imports = [ imports = [
./filesystems.nix ./filesystems.nix
@ -11,7 +12,8 @@
../../defaults/desktop ../../defaults/desktop
]; ];
virtualisation = { # TODO: This should probably be somewhere else. virtualisation = {
# TODO: This should probably be somewhere else.
docker = { docker = {
enable = true; enable = true;
enableOnBoot = false; enableOnBoot = false;
@ -38,5 +40,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -1,29 +1,39 @@
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
boot.initrd.luks.devices = { "luks".device = "/dev/disk/by-label/luks"; }; boot.initrd.luks.devices = {
"luks".device = "/dev/disk/by-label/luks";
fileSystems = let rootdev = "/dev/disk/by-label/hv_ochsenchopf";
in {
"/" = {
device = rootdev;
fsType = "btrfs";
options = [ "subvol=nixos" ];
};
"/home" = {
device = rootdev;
fsType = "btrfs";
options = [ "subvol=home" ];
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}; };
swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; fileSystems =
let
rootdev = "/dev/disk/by-label/hv_ochsenchopf";
in
{
"/" = {
device = rootdev;
fsType = "btrfs";
options = [ "subvol=nixos" ];
};
"/home" = {
device = rootdev;
fsType = "btrfs";
options = [ "subvol=home" ];
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
};
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
} }

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
imports = [ imports = [
./filesystems.nix ./filesystems.nix
@ -14,7 +15,8 @@
#../../defaults/printing #../../defaults/printing
]; ];
virtualisation = { # TODO: This should probably be somewhere else. virtualisation = {
# TODO: This should probably be somewhere else.
docker = { docker = {
enable = true; enable = true;
enableOnBoot = false; enableOnBoot = false;
@ -32,5 +34,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11"; # Did you read the comment?
} }

View file

@ -1,6 +1,11 @@
{ config, pkgs, lib, ... }: { {
boot.initrd.luks.devices.system.device = config,
"/dev/disk/by-uuid/bf353bb1-43bf-453f-ae7e-0fa9b4d8778c"; pkgs,
lib,
...
}:
{
boot.initrd.luks.devices.system.device = "/dev/disk/by-uuid/bf353bb1-43bf-453f-ae7e-0fa9b4d8778c";
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
fileSystems = { fileSystems = {

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
useDHCP = false; useDHCP = false;

View file

@ -2,15 +2,17 @@
{ {
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261"; hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{ hardware.printers.ensurePrinters = [
name = "hsr-mfp-8261"; {
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp"; name = "hsr-mfp-8261";
location = "HSR 8.261"; deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
model = "HP/hp-color_laserjet_mfp_m577-ps.ppd.gz"; location = "HSR 8.261";
ppdOptions = { model = "HP/hp-color_laserjet_mfp_m577-ps.ppd.gz";
Duplex = "DuplexNoTumble"; ppdOptions = {
PageSize = "A4"; Duplex = "DuplexNoTumble";
auth-info-required = "username,password"; PageSize = "A4";
}; auth-info-required = "username,password";
}]; };
}
];
} }

View file

@ -1,5 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
imports = [ ]; imports = [ ];
} }

View file

@ -3,5 +3,6 @@ with super.lib;
let let
# Load the system wide overlays # Load the system wide overlays
overlays = (import <nixpkgs/nixos> { }).config.nixpkgs.overlays; overlays = (import <nixpkgs/nixos> { }).config.nixpkgs.overlays;
# Apply all overlays to the input of the current "main" overlay in
in foldl' (flip extends) (_: super) overlays self # Apply all overlays to the input of the current "main" overlay
foldl' (flip extends) (_: super) overlays self

View file

@ -1,4 +1,3 @@
self: super: self: super: {
{
} }

View file

@ -1,12 +1,20 @@
{ pkgs ? import <nixpkgs-unstable> { } }: {
pkgs ? import <nixpkgs-unstable> { },
}:
pkgs.mkShell rec { pkgs.mkShell rec {
name = "qois-infrastructure-shell"; name = "qois-infrastructure-shell";
buildInputs = let buildInputs =
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ]; let
vscode-with-extensions = extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; }; vscode-with-extensions = pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; };
in with pkgs; [ vscode-with-extensions nixfmt rnix-lsp ]; in
with pkgs;
[
vscode-with-extensions
nixfmt
rnix-lsp
];
LANG = "C.UTF-8"; LANG = "C.UTF-8";
LC_ALL = "C.UTF-8"; LC_ALL = "C.UTF-8";
shellHook = '' shellHook = ''