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,10 +19,12 @@
''; '';
# 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 =
let
upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; upcall = "${pkgs.cifs-utils}/bin/cifs.upcall";
keyctl = "${pkgs.keyutils}/bin/keyctl"; keyctl = "${pkgs.keyutils}/bin/keyctl";
in '' in
''
#OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM #OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM
# -t is required for DFS share servers... # -t is required for DFS share servers...
create cifs.spnego * * ${upcall} -t %k create cifs.spnego * * ${upcall} -t %k

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;

View file

@ -15,34 +15,39 @@
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 =
let
sharedSpecialArgs = { sharedSpecialArgs = {
inherit pkgsUnstable; inherit pkgsUnstable;
pkgFccUnlock = fcc-unlock.packages.${system}.default; pkgFccUnlock = fcc-unlock.packages.${system}.default;
}; };
home-manager-config = { home-manager-config = {
home-manager = { home-manager = {
@ -55,7 +60,8 @@
]; ];
}; };
}; };
mapHostnameToAttr = host: mapHostnameToAttr =
host:
nixpkgs-stable.lib.nixosSystem { nixpkgs-stable.lib.nixosSystem {
inherit system; inherit system;
specialArgs = sharedSpecialArgs // { specialArgs = sharedSpecialArgs // {
@ -67,31 +73,21 @@
./host/${host}/default.nix ./host/${host}/default.nix
] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]); ] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]);
}; };
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr; 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,8 +84,7 @@
]; ];
#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"

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,10 +57,16 @@
rerere.enabled = true; rerere.enabled = true;
fetch.recurseSubmodules = "on-demand"; fetch.recurseSubmodules = "on-demand";
}; };
ignores = [ "*~" "*.swp" ".direnv/" ]; ignores = [
"*~"
"*.swp"
".direnv/"
];
lfs.enable = true; lfs.enable = true;
includes = let includes =
mkConfig = (dir: { let
mkConfig = (
dir: {
condition = "gitdir:${dir}"; condition = "gitdir:${dir}";
contents = { contents = {
user = { user = {
@ -69,8 +75,10 @@
name = "Fabian Hauser"; name = "Fabian Hauser";
}; };
}; };
}); }
in map mkConfig [ );
in
map mkConfig [
"~/private/" "~/private/"
"/etc/nixos/" "/etc/nixos/"
"~/.password-store/" "~/.password-store/"

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,7 +38,8 @@
enableSshSupport = true; enableSshSupport = true;
enableExtraSocket = true; enableExtraSocket = true;
# TODO: pinentryPackage = # TODO: pinentryPackage =
extraConfig = let extraConfig =
let
pinentryBemenu = pkgs.writeShellApplication { pinentryBemenu = pkgs.writeShellApplication {
name = "pinentry-bemenu-with-env"; name = "pinentry-bemenu-with-env";
text = '' text = ''
@ -44,7 +47,8 @@
"${pkgs.pinentry-bemenu}/bin/pinentry-bemenu" "$@" "${pkgs.pinentry-bemenu}/bin/pinentry-bemenu" "$@"
''; '';
}; };
in '' in
''
pinentry-program ${pinentryBemenu}/bin/pinentry-bemenu-with-env pinentry-program ${pinentryBemenu}/bin/pinentry-bemenu-with-env
''; '';
sshKeys = [ sshKeys = [

View file

@ -1,76 +1,108 @@
{ 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 =
let
backgroundPicturePath = "~/pictures/backgrounds"; backgroundPicturePath = "~/pictures/backgrounds";
backgroundCommand = '' backgroundCommand = ''
#swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill" #swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"
''; '';
mkScreen = (screen: { mkScreen = (
screen: {
criteria = screen; criteria = screen;
status = "enable"; status = "enable";
scale = 1.0; scale = 1.0;
}); }
);
homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53"; homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53";
p14sScreen = "BOE 0x08CE Unknown"; p14sScreen = "BOE 0x08CE Unknown";
in rec { in
rec {
#mobile-work.exec = backgroundCommand; #mobile-work.exec = backgroundCommand;
mobile-work.outputs = [ mobile-work.outputs = [
(mkScreen p14sScreen // { (
mkScreen p14sScreen
// {
position = "0,0"; position = "0,0";
scale = 2.0; scale = 2.0;
}) }
)
]; ];
mobile-work-external.outputs = [ mobile-work-external.outputs = [
(mkScreen p14sScreen // { (
mkScreen p14sScreen
// {
position = "1920,0"; position = "1920,0";
scale = 2.0; scale = 2.0;
}) }
)
(mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; }) (mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; })
]; ];
mobile-private.outputs = [ mobile-private.outputs = [
(mkScreen "Unknown 0x1536 0x00000000" // { (
mkScreen "Unknown 0x1536 0x00000000"
// {
position = "0,0"; position = "0,0";
scale = 1.5; scale = 1.5;
}) }
)
]; ];
home-dock.outputs = mobile-work.outputs ++ [ home-dock.outputs = mobile-work.outputs ++ [
(mkScreen homeDellScreen // { (
mkScreen homeDellScreen
// {
position = "1920,0"; position = "1920,0";
scale = 1.0; scale = 1.0;
status = "enable"; status = "enable";
}) }
)
]; ];
office-dock.outputs = [ office-dock.outputs = [
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; }) (mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; })
(mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; }) (mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; })
(mkScreen p14sScreen // { (
mkScreen p14sScreen
// {
position = "5120,0"; position = "5120,0";
scale = 2.0; scale = 2.0;
}) }
)
]; ];
office-cyrille-dock.outputs = [ office-cyrille-dock.outputs = [
(mkScreen "Acer Technologies Acer PE270K 0x0000B784" // { (
mkScreen "Acer Technologies Acer PE270K 0x0000B784"
// {
position = "0,0"; position = "0,0";
scale = 1.5; scale = 1.5;
}) }
(mkScreen p14sScreen // { )
(
mkScreen p14sScreen
// {
position = "2560,0"; position = "2560,0";
scale = 2.0; scale = 2.0;
}) }
)
]; ];
home-pc.outputs = [ home-pc.outputs = [
(mkScreen homeDellScreen // { position = "0,0"; }) (mkScreen homeDellScreen // { position = "0,0"; })
(mkScreen "HP Inc. HP Z27 CN482201RP" // { (
mkScreen "HP Inc. HP Z27 CN482201RP"
// {
position = "2560,0"; position = "2560,0";
scale = 1.5; scale = 1.5;
}) }
)
]; ];
home-pc-row.outputs = home-pc.outputs ++ [ home-pc-row.outputs = home-pc.outputs ++ [
(mkScreen "Eizo Nanao Corporation EV2450 92395086" // { (mkScreen "Eizo Nanao Corporation EV2450 92395086" // { position = "5120,0"; })
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,25 +1,34 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
programs.ssh = let {
programs.ssh =
let
forceIdentityThreema = { forceIdentityThreema = {
identityFile = toString (pkgs.writeText "fabian.hauser@threema.ch.pub" '' identityFile = toString (
pkgs.writeText "fabian.hauser@threema.ch.pub" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7h492sXT7zdamf+nbOt+y6jiqxicOnm6+wiuEG1EvZ openpgp:0x18B553DD ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7h492sXT7zdamf+nbOt+y6jiqxicOnm6+wiuEG1EvZ openpgp:0x18B553DD
''); ''
);
identitiesOnly = true; identitiesOnly = true;
}; };
forceIdentityPrivate = { forceIdentityPrivate = {
identityFile = toString (pkgs.writeText "fabian.hauser@qo.is.pub" '' identityFile = toString (
pkgs.writeText "fabian.hauser@qo.is.pub" ''
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000610954665 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000610954665
''); ''
);
identitiesOnly = true; identitiesOnly = true;
}; };
in { in
{
enable = true; enable = true;
matchBlocks = { matchBlocks = {
"work.github.com" = forceIdentityThreema // { "work.github.com" = forceIdentityThreema // {
hostname = "github.com"; hostname = "github.com";
user = "git"; user = "git";
}; };
"github.com" = forceIdentityPrivate // { user = "git"; }; "github.com" = forceIdentityPrivate // {
user = "git";
};
}; };
extraConfig = '' extraConfig = ''
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh

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";
@ -62,22 +72,25 @@ in rec {
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$"; class = "^Chromium-browser$";
instance = "^web.threema.ch"; instance = "^web.threema.ch";
}]; }
];
"13" = [ { class = "^Spotify$"; } ]; "13" = [ { class = "^Spotify$"; } ];
}; };
keybindings = let keybindings =
let
mod = wayland.windowManager.sway.config.modifier; mod = wayland.windowManager.sway.config.modifier;
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
wpctl = "${pkgs.wireplumber}/bin/wpctl"; wpctl = "${pkgs.wireplumber}/bin/wpctl";
light = "${pkgs.light}/bin/light"; light = "${pkgs.light}/bin/light";
in lib.mkOptionDefault { in
lib.mkOptionDefault {
"${mod}+p" = "exec passbemenu"; "${mod}+p" = "exec passbemenu";
"${mod}+Shift+d" = "${mod}+Shift+d" = "exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel";
"exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel";
"${mod}+x" = "move workspace to output right"; "${mod}+x" = "move workspace to output right";
"${mod}+y" = "move workspace to output left"; "${mod}+y" = "move workspace to output left";
@ -99,13 +112,10 @@ in rec {
"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 =
"exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%+";
XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"; XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
XF86AudioMicMute = XF86AudioMicMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
"exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
# Spotify control # Spotify control
XF86AudioPause = "exec ${playerctl} play-pause"; XF86AudioPause = "exec ${playerctl} play-pause";
@ -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,14 +1,15 @@
{ 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
lock = "${pkgs.swaylock}/bin/swaylock --hide-keyboard-layout --ignore-empty-password --daemonize --show-failed-attempts --color=000000";
logTimeCmd = "${pkgs.coreutils}/bin/date --rfc-3339=seconds >> ~/locklog"; logTimeCmd = "${pkgs.coreutils}/bin/date --rfc-3339=seconds >> ~/locklog";
idleCmd = (action: idleCmd = (action: ''${pkgs.sway}/bin/swaymsg "output * dpms ${action}" && ${logTimeCmd}'');
''${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 = { Unit = {
Description = "Idle Manager for Wayland"; Description = "Idle Manager for Wayland";
Documentation = [ "man:swayidle(1)" ]; Documentation = [ "man:swayidle(1)" ];
@ -21,14 +22,14 @@
timeout ${toString timeout-lock} '${lock}' \ timeout ${toString timeout-lock} '${lock}' \
timeout ${toString timeout-screens-off} '${idleCmd "off"}' \ timeout ${toString timeout-screens-off} '${idleCmd "off"}' \
resume '${idleCmd "on"}' \ resume '${idleCmd "on"}' \
timeout ${ timeout ${toString timeout-suspend} '${pkgs.systemd}/bin/systemctl suspend' \
toString timeout-suspend
} '${pkgs.systemd}/bin/systemctl suspend' \
lock '${lock}' \ lock '${lock}' \
before-sleep '${lock}'; before-sleep '${lock}';
''; # TODO: Make this configurable and add home-manager module. (Requires sway with systemd-target support) ''; # TODO: Make this configurable and add home-manager module. (Requires sway with systemd-target support)
}; };
Install = { WantedBy = [ "sway-session.target" ]; }; Install = {
WantedBy = [ "sway-session.target" ];
};
}; };
programs.swaylock.catppuccin.enable = true; programs.swaylock.catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = 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,10 +14,14 @@
enable = true; enable = true;
target = "tray.target"; target = "tray.target";
}; };
settings = [{ settings = [
{
position = "top"; position = "top";
#height = #height =
modules-left = [ "sway/mode" "sway/workspaces" ]; modules-left = [
"sway/mode"
"sway/workspaces"
];
modules-center = [ "sway/window" ]; modules-center = [ "sway/window" ];
modules-right = [ modules-right = [
"idle_inhibitor" "idle_inhibitor"
@ -68,8 +78,7 @@
}; };
"sway/mode" = { "sway/mode" = {
format = format = ''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt
''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt
tooltip = "false"; tooltip = "false";
}; };
@ -102,7 +111,11 @@
phone = ""; phone = "";
portable = ""; portable = "";
car = ""; car = "";
default = [ "" "" "" ]; default = [
""
""
""
];
}; };
on-click = "pavucontrol"; on-click = "pavucontrol";
}; };
@ -119,7 +132,8 @@
icon-size = "21"; icon-size = "21";
spacing = "10"; 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,22 +1,33 @@
{ 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 =
let
browser = [ "firefox.desktop" ]; browser = [ "firefox.desktop" ];
email = [ "org.gnome.Evolution.desktop" ]; email = [ "org.gnome.Evolution.desktop" ];
doc-editor = [ "writer.desktop" ]; doc-editor = [ "writer.desktop" ];
sheet-editor = [ "calc.desktop" ]; sheet-editor = [ "calc.desktop" ];
presentation-editor = [ "impress.desktop" ]; presentation-editor = [ "impress.desktop" ];
pdf = [ "org.gnome.Evince.desktop" ]; pdf = [ "org.gnome.Evince.desktop" ];
image = [ "org.gnome.Loupe.desktop" "gimp.desktop" ]; image = [
"org.gnome.Loupe.desktop"
"gimp.desktop"
];
image-vector = [ "org.inkscape.Inkscape.desktop" ]; image-vector = [ "org.inkscape.Inkscape.desktop" ];
ebooks = [ "calibre-ebook-viewer.desktop" ]; ebooks = [ "calibre-ebook-viewer.desktop" ];
code-general = [ "codium.desktop" ]; code-general = [ "codium.desktop" ];
video = [ "mpv.desktop" ]; video = [ "mpv.desktop" ];
compression = [ "org.gnome.Nautilus.desktop" ]; compression = [ "org.gnome.Nautilus.desktop" ];
in { in
{
"text/html" = browser; "text/html" = browser;
"x-scheme-handler/http" = browser; "x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser; "x-scheme-handler/https" = browser;
@ -31,12 +42,9 @@
"text/calendar" = 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.openxmlformats-officedocument.presentationml.presentation" =
presentation-editor;
"application/vnd.oasis.opendocument.presentation" = presentation-editor; "application/vnd.oasis.opendocument.presentation" = presentation-editor;
"application/pdf" = pdf; "application/pdf" = pdf;
"application/x-extension-pdf" = pdf; "application/x-extension-pdf" = pdf;

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";
@ -26,5 +32,4 @@
# 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,7 +2,8 @@
{ {
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261"; hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{ hardware.printers.ensurePrinters = [
{
name = "hsr-mfp-8261"; name = "hsr-mfp-8261";
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp"; deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
location = "HSR 8.261"; location = "HSR 8.261";
@ -12,5 +13,6 @@
PageSize = "A4"; PageSize = "A4";
auth-info-required = "username,password"; 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,9 +1,20 @@
{ 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"; fileSystems =
in { let
rootdev = "/dev/disk/by-label/hv_ochsenchopf";
in
{
"/" = { "/" = {
device = rootdev; device = rootdev;
fsType = "btrfs"; fsType = "btrfs";
@ -25,5 +36,4 @@
# 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,7 +2,8 @@
{ {
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261"; hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{ hardware.printers.ensurePrinters = [
{
name = "hsr-mfp-8261"; name = "hsr-mfp-8261";
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp"; deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
location = "HSR 8.261"; location = "HSR 8.261";
@ -12,5 +13,6 @@
PageSize = "A4"; PageSize = "A4";
auth-info-required = "username,password"; 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;
in
# Apply all overlays to the input of the current "main" overlay # Apply all overlays to the input of the current "main" overlay
in foldl' (flip extends) (_: super) overlays self 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 =
let
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ]; extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
vscode-with-extensions = vscode-with-extensions = pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; };
pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; }; in
in with pkgs; [ vscode-with-extensions nixfmt rnix-lsp ]; 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 = ''