From c0466602b7b3b3e29bbd470d4f57b488679e9c72 Mon Sep 17 00:00:00 2001 From: tristan Date: Sat, 15 Apr 2023 12:46:15 +0100 Subject: [PATCH] add work laptop --- flake.nix | 1 + global.nix | 2 ++ hardware/work.nix | 48 ++++++++++++++++++++++++++++++++++++++++++ home.nix | 2 ++ hyprland/hyprland.conf | 21 +++++------------- scripts/autostart | 5 ++--- system/work.nix | 23 ++++++++++++++++++++ system/zenix.nix | 1 - 8 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 hardware/work.nix create mode 100644 system/work.nix diff --git a/flake.nix b/flake.nix index 965a71e..8f9a265 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ in { nixosConfigurations = { zenix = mkConf "zenix" { inherit nixpkgs system user home-manager; }; + FCS-Tristan-Nixbook = mkConf "work" { inherit nixpkgs system user home-manager; }; }; }; } diff --git a/global.nix b/global.nix index f637e5a..50597ef 100644 --- a/global.nix +++ b/global.nix @@ -32,6 +32,8 @@ security.doas.enable = true; + i18n.defaultLocale = "en_GB.UTF-8"; + # Configure graphical stuff services.xserver = { enable = true; diff --git a/hardware/work.nix b/hardware/work.nix new file mode 100644 index 0000000..335310a --- /dev/null +++ b/hardware/work.nix @@ -0,0 +1,48 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/48a07e82-1090-448c-a751-3a410afba0f7"; + fsType = "btrfs"; + options = [ "subvol=@" "compress=zstd" "autodefrag" ]; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/570cc51f-bd5c-4bee-a18f-f6aabaf60881"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/48a07e82-1090-448c-a751-3a410afba0f7"; + fsType = "btrfs"; + options = [ "subvol=@home" "compress=zstd" "autodefrag" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/EED9-A165"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp53s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp54s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix index 160dfb1..ab065d8 100644 --- a/home.nix +++ b/home.nix @@ -201,6 +201,7 @@ ]; userSettings = { "vscode-neovim.neovimExecutablePaths.linux" = "/run/current-system/sw/bin/nvim"; + "keyboard.dispatch" = "keyCode"; }; }; @@ -211,6 +212,7 @@ notmuch.enable = true; neomutt.enable = true; mbsync.enable = true; + mbsync.create = "maildir"; userName = "tristan@tristans.cloud"; realName = "Tristan"; address = "tristan@tristans.cloud"; diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf index d026615..70b17cd 100644 --- a/hyprland/hyprland.conf +++ b/hyprland/hyprland.conf @@ -7,15 +7,15 @@ monitor=HDMI-A-1,1920x1080@60,1920x0,1 input { kb_file= kb_layout=gb - #kb_variant=dvorak + kb_variant=dvorak kb_model= - #kb_options=caps:escape + kb_options=caps:escape kb_rules= follow_mouse=1 touchpad { - natural_scroll=no + natural_scroll=yes } sensitivity=0 @@ -57,24 +57,14 @@ dwindle { } gestures { - workspace_swipe=no + workspace_swipe=yes } -# example window rules -# for windows named/classed as abc and xyz -#windowrule=move 69 420,abc -#windowrule=size 420 69,abc -#windowrule=tile,xyz -#windowrule=float,abc -#windowrule=pseudo,abc -#windowrule=monitor 0,xyz - -# some nice mouse binds bindm=SUPER,mouse:272,movewindow bindm=SUPER,mouse:273,resizewindow bind=SUPER,RETURN,exec,foot -bind=SUPER_SHIFT,X,killactive, +bind=SUPER_SHIFT,Q,killactive, bind=SUPER,M,exec,foot -e ncmpcpp bind=SUPER,E,exec,foot -e neomutt bind=SUPER,O,exec,pcmanfm @@ -88,7 +78,6 @@ bind=SUPER,slash,exec,brave bind=SUPER,V,togglefloating, bind=SUPER,F,fullscreen, bind=SUPER,d,exec,wofi --show drun -#bind=SUPER,d,exec,nwg-drawer bind=SUPER_SHIFT,P,exec,bwmenu bind=SUPER,apostrophe,exec,notify-send -i mpv "$(playerctl metadata --format '{{title}}')" "$(playerctl metadata --format '{{album}}')" -t 3000 bind=SUPER_SHIFT,E,exit, diff --git a/scripts/autostart b/scripts/autostart index f7f5471..6adf935 100755 --- a/scripts/autostart +++ b/scripts/autostart @@ -4,11 +4,10 @@ nextcloud & waybar & swaybg \ + -o eDP-1 -i ~/Pictures/backgrounds/nix-wallpaper-waterfall.png \ -o DP-1 -i ~/Pictures/backgrounds/demonslayer.jpg \ -o HDMI-A-1 -i ~/Pictures/backgrounds/nier.jpg & swayidle -w \ - timeout 600 'swaylock &' & # swaymsg dunt work \ - # timeout 400 'swaymsg "output * dpms off"' \ - # resume 'swaymsg "output * dpms on"' & + timeout 600 'swaylock &' & diff --git a/system/work.nix b/system/work.nix new file mode 100644 index 0000000..d775141 --- /dev/null +++ b/system/work.nix @@ -0,0 +1,23 @@ +# https://search.nixos.org/options + +{ config, pkgs, ... }: +{ + + networking.hostName = "FCS-Tristan-Nixbook"; + + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; + }; + services.xserver = { + layout = "gb"; + xkbVariant = "dvorak"; + xkbOptions = "caps:escape"; + }; + + networking.firewall.allowedTCPPorts = [ ]; + + system.stateVersion = "22.11"; # do not change + +} + diff --git a/system/zenix.nix b/system/zenix.nix index 3fe7f44..1e3a19c 100644 --- a/system/zenix.nix +++ b/system/zenix.nix @@ -5,7 +5,6 @@ networking.hostName = "zenix"; - i18n.defaultLocale = "en_GB.UTF-8"; console = { font = "Lat2-Terminus16"; };