Compare commits

...

7 Commits

16 changed files with 93 additions and 76 deletions

View File

@ -13,7 +13,7 @@ rec {
pictures = "${dir.home}/Pictures"; pictures = "${dir.home}/Pictures";
}; };
hostname = "nixos"; hostname = "thinkpad";
keymaps = { keymaps = {
layout = "gb,no"; layout = "gb,no";
@ -21,8 +21,7 @@ rec {
}; };
# Empty matches all # Empty matches all
monitor1 = "DP-1"; monitor1 = "";
monitor2 = "DP-3";
username = "martin"; username = "martin";

View File

@ -39,6 +39,7 @@ in
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
brightnessctl
wget wget
xdg-utils xdg-utils
xdg-desktop-portal xdg-desktop-portal

View File

@ -42,7 +42,7 @@
common = import ./common.nix; common = import ./common.nix;
in in
{ {
defaultPackage.${system} = home-manager.defaultPackage.${system}; defaultPackages.${system} = home-manager.defaultPackage.${system};
# The minimum amount of dependencies in order to run 'just switch-now' # The minimum amount of dependencies in order to run 'just switch-now'
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {

View File

@ -12,7 +12,7 @@
signing = { signing = {
signByDefault = true; signByDefault = true;
key = "706F53DD087A91DE"; key = "848D71DE0590C199";
}; };
extraConfig = { extraConfig = {

View File

@ -39,6 +39,7 @@ in
"network" "network"
"systray" "systray"
"clock" "clock"
"battery"
"notifications" "notifications"
]; ];
}; };

View File

@ -1,5 +1,6 @@
# Wallpapers # Wallpapers
{ pkgs, ... }: { pkgs, ... }:
let let
common = import ../../common.nix; common = import ../../common.nix;
in in
@ -14,7 +15,6 @@ in
let let
wallpaperDir = ../../wallpapers; wallpaperDir = ../../wallpapers;
monitor1 = "${wallpaperDir}/nixos_waves.png"; monitor1 = "${wallpaperDir}/nixos_waves.png";
monitor2 = "${wallpaperDir}/ekg_v2.png";
in in
{ {
ipc = "on"; ipc = "on";
@ -23,12 +23,10 @@ in
preload = [ preload = [
monitor1 monitor1
monitor2
]; ];
wallpaper = [ wallpaper = [
"${common.monitor1},${monitor1}" "${common.monitor1},${monitor1}"
"${common.monitor2},${monitor2}"
]; ];
}; };
}; };

View File

@ -7,8 +7,7 @@ in
{ {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
monitor = [ monitor = [
"${common.monitor1}, 3440x1440@175, 0x0, 1" "${common.monitor1}, 1920x1080@60.05, 0x0, 1"
"${common.monitor2}, 3840x2160@60, 3440x0, 1.5, transform, 1"
]; ];
# Autostart # Autostart
@ -16,6 +15,7 @@ in
app.browser app.browser
app.terminal app.terminal
"systemctl --user start hyprpolkitagent" "systemctl --user start hyprpolkitagent"
"hyprsunset -t 5000" # Set blue light filter
]; ];
env = [ env = [
@ -105,11 +105,16 @@ in
kb_layout = common.keymaps.layout; kb_layout = common.keymaps.layout;
kb_options = common.keymaps.options; kb_options = common.keymaps.options;
follow_mouse = 1; follow_mouse = 1;
sensitivity = 0; # -1.0 - 1.0, 0 means no modification. sensitivity = 0.4; # -1.0 - 1.0, 0 means no modification.
touchpad.natural_scroll = false; touchpad.natural_scroll = true;
}; };
gestures.workspace_swipe = false; gestures = {
workspace_swipe = true;
workspace_swipe_distance = 150;
workspace_swipe_min_speed_to_force = 0;
workspace_swipe_cancel_ratio = 0.5;
};
device = { device = {
name = "logitech-g502-hero-gaming-mouse"; name = "logitech-g502-hero-gaming-mouse";

View File

@ -15,19 +15,19 @@
"custom/notification", "custom/notification",
"tray", "tray",
"custom/lock", "custom/lock",
"custom/power" "custom/power",
], ],
"hyprland/workspaces": { "hyprland/workspaces": {
"disable-scroll": false, "disable-scroll": false,
"sort-by-name": true, "sort-by-name": true,
"format": " {id} " "format": " {id} ",
}, },
"hyprland/window": { "hyprland/window": {
"format": "{initialTitle}" "format": "{initialTitle}",
}, },
"tray": { "tray": {
"icon-size": 21, "icon-size": 21,
"spacing": 10 "spacing": 10,
}, },
// TODO better music module // TODO better music module
"custom/music": { "custom/music": {
@ -37,7 +37,7 @@
"tooltip": false, "tooltip": false,
"exec": "playerctl metadata --format='{{ title }}'", "exec": "playerctl metadata --format='{{ title }}'",
"on-click": "playerctl play-pause", "on-click": "playerctl play-pause",
"max-length": 50 "max-length": 50,
}, },
"clock": { "clock": {
"timezone": "Europe/Oslo", "timezone": "Europe/Oslo",
@ -51,39 +51,39 @@
"days": "<span color='#ecc6d9'><b>{}</b></span>", "days": "<span color='#ecc6d9'><b>{}</b></span>",
"weeks": "<span color='#99ffdd'><b>W{}</b></span>", "weeks": "<span color='#99ffdd'><b>W{}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>", "weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b><u>{}</u></b></span>" "today": "<span color='#ff6699'><b><u>{}</u></b></span>",
} },
} },
}, },
"backlight": { "backlight": {
"device": "intel_backlight", "device": "intel_backlight",
"format": "{icon}", "format": "{icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""] "format-icons": ["", "", "", "", "", "", "", "", ""],
}, },
"wireplumber": { "wireplumber": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}%", "format": "{icon} {volume}%",
"format-muted": " ", "format-muted": " ",
"format-icons": { "format-icons": {
"default": ["", " ", " "] "default": ["", " ", " "],
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol",
}, },
"hyprland/language": { "hyprland/language": {
"format-en": "EN", "format-en": "EN",
"format-no": "NO", "format-no": "NO",
"keyboard-name": "logitech-logitech-g710-keyboard", "keyboard-name": "logitech-logitech-g710-keyboard",
"on-click": "hyprctl switchxkblayout logitech-logitech-g710-keyboard next" "on-click": "hyprctl switchxkblayout logitech-logitech-g710-keyboard next",
}, },
"custom/lock": { "custom/lock": {
"tooltip": false, "tooltip": false,
"on-click": "sh -c '(sleep 0.5s; hyprlock)'", "on-click": "sh -c '(sleep 0.5s; hyprlock)'",
"format": "" "format": "",
}, },
"custom/power": { "custom/power": {
"tooltip": false, "tooltip": false,
"on-click": "wlogout &", "on-click": "wlogout &",
"format": " " "format": " ",
}, },
"custom/notification": { "custom/notification": {
"tooltip": false, "tooltip": false,
@ -96,13 +96,13 @@
"inhibited-notification": "<span foreground='#f38ba8'><sup></sup></span>", "inhibited-notification": "<span foreground='#f38ba8'><sup></sup></span>",
"inhibited-none": "", "inhibited-none": "",
"dnd-inhibited-notification": "<span foreground='#f38ba8'><sup></sup></span>", "dnd-inhibited-notification": "<span foreground='#f38ba8'><sup></sup></span>",
"dnd-inhibited-none": "" "dnd-inhibited-none": "",
}, },
"return-type": "json", "return-type": "json",
"exec-if": "which swaync-client", "exec-if": "which swaync-client",
"exec": "swaync-client -swb", "exec": "swaync-client -swb",
"on-click": "swaync-client -t -sw", "on-click": "swaync-client -t -sw",
"on-click-right": "swaync-client -d -sw", "on-click-right": "swaync-client -d -sw",
"escape": true "escape": true,
} },
} }

6
modules/battery.nix Normal file
View File

@ -0,0 +1,6 @@
{
services = {
upower.enable = true;
power-profiles-daemon.enable = true;
};
}

View File

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./battery.nix
./development.nix ./development.nix
./fonts.nix ./fonts.nix
./gnome ./gnome

View File

@ -37,6 +37,5 @@
services.ollama = { services.ollama = {
enable = true; enable = true;
acceleration = "cuda";
}; };
} }

View File

@ -1,7 +1,5 @@
{ {
imports = [ imports = [ ];
./nvidia.nix
];
# Enable OpenGL # Enable OpenGL
hardware.graphics.enable = true; hardware.graphics.enable = true;

View File

@ -1,28 +0,0 @@
{ pkgs, ... }:
{
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
# For hardware acceleration
environment.sessionVariables.LIBVA_DRIVER_NAME = "nvidia";
hardware = {
graphics.extraPackages = with pkgs; [
# Used for hardware-acceleration
nvidia-vaapi-driver
];
nvidia = {
# Required
modesetting.enable = true;
# Use closed-source drivers
open = false;
# Enable the Nvidia settings menu
nvidiaSettings = true;
# Enable nvidia-suspend.service, nvidia-hibernate.service and nvidia-resume.service
powerManagement.enable = true;
};
};
# Load Nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = [ "nvidia" ];
}

View File

@ -15,26 +15,26 @@
]; ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme" "nvme"
"xhci_pci"
"usb_storage" "usb_storage"
"usbhid"
"sd_mod" "sd_mod"
"sr_mod" "sdhci_pci"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/5e3f0f97-4bb4-4a53-ace2-9ed19ff9e8ea"; device = "/dev/disk/by-uuid/5ac9c425-35ae-47d5-a683-68ee0dbfc2bc";
fsType = "btrfs"; fsType = "ext4";
options = [ "subvol=@" ];
}; };
boot.initrd.luks.devices."luks-99b73f22-3fa1-42b5-ad48-54b0ccff72cc".device =
"/dev/disk/by-uuid/99b73f22-3fa1-42b5-ad48-54b0ccff72cc";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D188-48A9"; device = "/dev/disk/by-uuid/3CFB-D12A";
fsType = "vfat"; fsType = "vfat";
options = [ options = [
"fmask=0077" "fmask=0077"
@ -49,10 +49,9 @@
# still possible to use this option, but it's recommended to use it in conjunction # still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true; # networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s20f0u8.useDHCP = lib.mkDefault true; # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View File

@ -6,6 +6,7 @@
xdg-desktop-portal-hyprland xdg-desktop-portal-hyprland
hyprpolkitagent # Auth deamon providing modals for password auth hyprpolkitagent # Auth deamon providing modals for password auth
hyprshot # Screenshots hyprshot # Screenshots
hyprsunset # Blue light filter
unstable.hyprsysteminfo unstable.hyprsysteminfo
unstable.hyprland-qtutils unstable.hyprland-qtutils
unstable.hyprland-qt-support unstable.hyprland-qt-support

View File

@ -11,7 +11,27 @@
security = { security = {
pam = { pam = {
services = { services = {
login.u2fAuth = false; # U2F and password gdm-fingerprint.text = ''
auth required pam_shells.so
auth requisite pam_nologin.so
auth requisite pam_faillock.so preauth
auth required ${pkgs.fprintd}/lib/security/pam_fprintd.so
auth optional pam_permit.so
auth required pam_env.so
auth [success=ok default=1] ${pkgs.gdm}/lib/security/pam_gdm.so
auth optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so
account include login
password required pam_deny.so
session include login
session optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start
'';
login = {
fprintAuth = false;
u2fAuth = false; # U2F and password
};
sudo.u2fAuth = true; # U2F or password sudo.u2fAuth = true; # U2F or password
}; };
u2f = { u2f = {
@ -24,6 +44,23 @@
}; };
}; };
# Start the driver at boot
systemd.services.fprintd = {
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "simple";
};
# Install the driver
services.fprintd = {
enable = true;
tod.driver = pkgs.libfprint-2-tod1-goodix-550a; # Goodix 550a driver (from Lenovo)
};
# however for focaltech 2808:a658, use fprintd with overidden package (without tod)
# services.fprintd.package = pkgs.fprintd.override {
# libfprint = pkgs.libfprint-focaltech-2808-a658;
# };
services = { services = {
pcscd.enable = true; # Required for Yubikey pcscd.enable = true; # Required for Yubikey
udev.packages = with pkgs; [ yubikey-personalization ]; udev.packages = with pkgs; [ yubikey-personalization ];