From dfc0391d27c23d2051ec7ef1166c3585ad44be38 Mon Sep 17 00:00:00 2001 From: tristan Date: Thu, 3 Apr 2025 17:05:52 +0100 Subject: [PATCH 1/5] framework: install --- flake.nix | 13 ++++++ hardware/framework-14.nix | 88 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 hardware/framework-14.nix diff --git a/flake.nix b/flake.nix index f52a96d..cf9da0f 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,19 @@ ]; }; + framework-14 = mkConf { + nixos-modules = [ + ./hardware/framework-14.nix + ./nixos/workstation.nix + ./nixos/modules/work.nix + ./nixos/programs/hyprland.nix + ]; + home-modules = [ + ./home/programs/work.nix + ./home/programs/graphical.nix + ]; + }; + alpine = mkConf { nixos-modules = [ ./hardware/alpine.nix diff --git a/hardware/framework-14.nix b/hardware/framework-14.nix new file mode 100644 index 0000000..d093b25 --- /dev/null +++ b/hardware/framework-14.nix @@ -0,0 +1,88 @@ +# 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" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + fsType = "btrfs"; + options = [ "subvol=@root" ]; + }; + + boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/84ad0e15-0056-4d46-801d-7735c2c6a5f6"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9EA1-04BB"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/b22fb59e-3882-4acc-b7cd-d24916ae3c63"; } + ]; + + # 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.wlp166s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + + networking.hostName = "framework-14"; + + system.stateVersion = "24.11"; # do not change + home-manager.users.${config.user}.imports = [ + { + home.stateVersion = "24.11"; + + wayland.windowManager.hyprland = { + settings = { + bind = [ + "SUPER_SHIFT, Q, killactive," + ]; + }; + extraConfig = '' + device { + name = at-translated-set-2-keyboard + kb_variant = dvorak, + kb_layout = gb,gb + kb_options = grp:alt_shift_toggle,caps:escape + } + ''; + }; + } + ]; + + + + + + +} + + From 3d18f696aa77d7957e0ae0e0ff388ea64162964a Mon Sep 17 00:00:00 2001 From: tristan Date: Thu, 3 Apr 2025 18:21:13 +0100 Subject: [PATCH 2/5] framework: fix brightness scripts --- hardware/framework-14.nix | 5 +++++ home/programs/scripts.nix | 29 +++++++++++------------------ nixos/default.nix | 5 ++++- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/hardware/framework-14.nix b/hardware/framework-14.nix index d093b25..157c653 100644 --- a/hardware/framework-14.nix +++ b/hardware/framework-14.nix @@ -79,6 +79,11 @@ ]; + stylix.fonts.sizes = { + applications = 20; + desktop = 12; + terminal = 20; + }; diff --git a/home/programs/scripts.nix b/home/programs/scripts.nix index f0943e0..c95db57 100644 --- a/home/programs/scripts.nix +++ b/home/programs/scripts.nix @@ -1,6 +1,7 @@ { config, pkgs, + lib, ... }: let modifier = config.windowManager.modifierKey; @@ -9,6 +10,7 @@ my-deps = { notify-send = "${pkgs.libnotify}/bin/notify-send"; playerctl = "${pkgs.playerctl}/bin/playerctl"; + brightnessctl = lib.getExe pkgs.brightnessctl; grim = "${pkgs.grim}/bin/grim"; slurp = "${pkgs.slurp}/bin/slurp"; amixer = "${pkgs.alsa-utils}/bin/amixer"; @@ -103,44 +105,35 @@ in { ]; } { - name = "brightness-down"; + name = "brightness"; text = '' - light -U $1 - ${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-down -t 1000 + percent=$(${my-deps.brightnessctl} set $1 -m | awk -F, '{print $4}') + + ${my-deps.notify-send} "Brightness" -h "int:value:$percent" -h string:x-canonical-private-synchronous:brightness -t 3000 ''; hotkeys = [ { modifier = ""; key = "XF86MonBrightnessDown"; - args = "10"; + args = "10%-"; } { modifier = "SHIFT"; key = "XF86MonBrightnessDown"; - args = "1"; + args = "1%-"; } - ]; - install = false; - } - { - name = "brightness-up"; - text = '' - light -A $1 - ${my-deps.notify-send} "Brightness" -h int:value:$(light) -a brightness-up -t 1000 - ''; - hotkeys = [ { modifier = ""; key = "XF86MonBrightnessUp"; - args = "10"; + args = "+10%"; } { modifier = "SHIFT"; key = "XF86MonBrightnessUp"; - args = "1"; + args = "+1%"; } ]; - install = false; + install = true; } { name = "picker"; diff --git a/nixos/default.nix b/nixos/default.nix index 55d0635..c36836d 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -29,7 +29,10 @@ in { boot.loader.efi.canTouchEfiVariables = true; networking.networkmanager.enable = true; - programs.nm-applet.enable = true; + programs.nm-applet = { + enable = true; + indicator = true; + }; # fix nixos-containers networking.nat.enable = true; From 58a2547bc5758f4a6ca4789e3c51e116647e0037 Mon Sep 17 00:00:00 2001 From: tristan Date: Thu, 3 Apr 2025 18:59:17 +0100 Subject: [PATCH 3/5] framework: tweaks --- hardware/framework-14.nix | 22 ++++++++++------------ home/programs/graphical.nix | 6 +++++- home/programs/work.nix | 23 ++++++----------------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/hardware/framework-14.nix b/hardware/framework-14.nix index 157c653..70f56a1 100644 --- a/hardware/framework-14.nix +++ b/hardware/framework-14.nix @@ -1,6 +1,3 @@ -# 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, ... }: { @@ -14,7 +11,7 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + { device = "/dev/mapper/crypted"; fsType = "btrfs"; options = [ "subvol=@root" ]; }; @@ -22,24 +19,25 @@ boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/84ad0e15-0056-4d46-801d-7735c2c6a5f6"; fileSystems."/home" = - { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + { device = "/dev/mapper/crypted"; fsType = "btrfs"; options = [ "subvol=@home" ]; }; fileSystems."/nix" = - { device = "/dev/disk/by-uuid/745ff46c-6fec-44cf-97eb-40ced0442b0d"; + { device = "/dev/mapper/crypted"; fsType = "btrfs"; - options = [ "subvol=@nix" ]; + neededForBoot = true; + options = [ "subvol=@nix" "noatime" ]; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/9EA1-04BB"; + { device = "/dev/disk/by-label/BOOT"; fsType = "vfat"; }; swapDevices = - [ { device = "/dev/disk/by-uuid/b22fb59e-3882-4acc-b7cd-d24916ae3c63"; } + [ { device = "/dev/disk/by-label/SWAP"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -80,9 +78,9 @@ stylix.fonts.sizes = { - applications = 20; - desktop = 12; - terminal = 20; + applications = 12; + desktop = 10; + terminal = 15; }; diff --git a/home/programs/graphical.nix b/home/programs/graphical.nix index 7a59f0c..98d78a1 100644 --- a/home/programs/graphical.nix +++ b/home/programs/graphical.nix @@ -28,7 +28,6 @@ # other element-desktop - brave bitwarden ]; @@ -55,4 +54,9 @@ "file:///home/tristan/Downloads" ]; }; + + programs.chromium = { + enable = true; + package = pkgs.brave; + }; } diff --git a/home/programs/work.nix b/home/programs/work.nix index 7417aba..2993d8a 100644 --- a/home/programs/work.nix +++ b/home/programs/work.nix @@ -4,11 +4,6 @@ ... }: let modifier = config.windowManager.modifierKey; - browser = "${pkgs.brave}/opt/brave.com/brave/brave-browser"; - pwa = { - slack = "mpagibdhafmlkgpemeicgogjnhclenoc"; - teams = "cifhbcnohmdccbgoicgdjpfamggdegmo"; - }; in { roles.email = { enable = true; @@ -26,16 +21,6 @@ in { pkgs.thunderbird pkgs.remmina pkgs.postman - (import ../../lib/mkapp.nix "slack" { - inherit pkgs browser; - desktopName = "Slack"; - app-id = pwa.slack; - }) - (import ../../lib/mkapp.nix "teams" { - inherit pkgs browser; - app-id = pwa.teams; - desktopName = "Microsoft Teams"; - }) pkgs.devcontainer (pkgs.writeShellScriptBin "devcontainer-open" ( let @@ -77,8 +62,12 @@ in { wayland.windowManager.hyprland.settings = { bind = [ "${modifier}, e, focuswindow, thunderbird" - "${modifier}, t, focuswindow, brave-${pwa.teams}-Profile_2" - "${modifier}, s, focuswindow, brave-${pwa.slack}-Profile_2" + ]; + }; + + programs.chromium = { + extensions = [ + {id = "bfogiafebfohielmmehodmfbbebbbpei";} ]; }; } From 5a952051c3605453ab40ea7d7457a78c75aebb41 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 4 Apr 2025 10:17:47 +0100 Subject: [PATCH 4/5] framework: stuff --- flake.nix | 4 ++-- .../{framework-14.nix => framework-13.nix} | 5 +--- home/workstation.nix | 24 ------------------- 3 files changed, 3 insertions(+), 30 deletions(-) rename hardware/{framework-14.nix => framework-13.nix} (98%) diff --git a/flake.nix b/flake.nix index cf9da0f..e9df1b6 100644 --- a/flake.nix +++ b/flake.nix @@ -68,9 +68,9 @@ ]; }; - framework-14 = mkConf { + framework-13 = mkConf { nixos-modules = [ - ./hardware/framework-14.nix + ./hardware/framework-13.nix ./nixos/workstation.nix ./nixos/modules/work.nix ./nixos/programs/hyprland.nix diff --git a/hardware/framework-14.nix b/hardware/framework-13.nix similarity index 98% rename from hardware/framework-14.nix rename to hardware/framework-13.nix index 70f56a1..72e8c3a 100644 --- a/hardware/framework-14.nix +++ b/hardware/framework-13.nix @@ -51,7 +51,7 @@ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - networking.hostName = "framework-14"; + networking.hostName = "framework-13"; system.stateVersion = "24.11"; # do not change home-manager.users.${config.user}.imports = [ @@ -83,9 +83,6 @@ terminal = 15; }; - - - } diff --git a/home/workstation.nix b/home/workstation.nix index 125e657..7b5b109 100644 --- a/home/workstation.nix +++ b/home/workstation.nix @@ -48,30 +48,6 @@ } ] ''; - xdg.configFile."pipewire/pipewire.conf.d/raop-sink.conf".text = '' - context.modules = [ - { name = libpipewire-module-raop-sink - args = { - # Set the remote address to tunnel to - raop.ip = "127.0.0.1" - raop.port = 8190 - raop.name = "my-raop-device" - raop.hostname = "My Service" - #raop.transport = "udp" - raop.encryption.type = "RSA" - #raop.audio.codec = "PCM" - #raop.password = "****" - #audio.format = "S16" - #audio.rate = 44100 - #audio.channels = 2 - #audio.position = [ FL FR ] - stream.props = { - # extra sink properties - } - } - } - ] - ''; services.gnome-keyring.enable = true; } From 158210f009b6eabf2b573f9d9dbc6374f005f97d Mon Sep 17 00:00:00 2001 From: tristan Date: Mon, 7 Apr 2025 14:24:03 +0100 Subject: [PATCH 5/5] framework: fix locking and ozone --- home/desktop/hyprland/default.nix | 3 ++- home/desktop/hyprland/hycov.nix | 25 ------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 home/desktop/hyprland/hycov.nix diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix index df36e65..704dfab 100644 --- a/home/desktop/hyprland/default.nix +++ b/home/desktop/hyprland/default.nix @@ -30,7 +30,7 @@ in { enable = true; settings = { general = { - before_sleep_cmd = "rbw lock"; + before_sleep_cmd = "rbw lock; hyprlock"; after_sleep_cmd = "hyprctl dispatch dpms on"; ignore_dbus_inhibit = false; lock_cmd = "pidof ${lock_cmd} || ${lock_cmd}"; @@ -193,6 +193,7 @@ in { "XDG_SESSION_DESKTOP,Hyprland" "QT_AUTO_SCREEN_SCALE_FACTOR,1" "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "NIXOS_OZONE_WL,1" ]; windowrule = [ "float, title:wlogout" diff --git a/home/desktop/hyprland/hycov.nix b/home/desktop/hyprland/hycov.nix deleted file mode 100644 index cf62e31..0000000 --- a/home/desktop/hyprland/hycov.nix +++ /dev/null @@ -1,25 +0,0 @@ -{pkgs, ...}: { - wayland.windowManager.hyprland = { - plugins = with pkgs; [ - hycov - ]; - settings.plugin.hycov = { - overview_gappo = 20; - }; - settings.bind = [ - # bind key to toggle overview(normal mode) - "ALT,tab,hycov:toggleoverview" - - # bind key to toggle overview(force mode,no affected by `only_active_workspace` and `only_active_monitor`) - "ALT,grave,hycov:toggleoverview,forceall" #grave key is the '~' key - - # The direction switch shortcut key binding. - # calculate the window closest to the direction to switch focus. - # This keybind is applicable not only to the overview but also to the general layout - "ALT,h,hycov:movefocus,l" - "ALT,l,hycov:movefocus,r" - "ALT,k,hycov:movefocus,u" - "ALT,j,hycov:movefocus,d" - ]; - }; -}