From 4c0760495f58e921e79affc0dd534bdd24529b72 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 10 Jun 2024 09:56:13 -0500 Subject: [PATCH] Fix foxtrot, add valerie, other fixes --- flake.lock | 6 ++-- flake.nix | 7 +--- modules/home-manager/cargo.nix | 6 +++- modules/home-manager/common.nix | 19 ----------- modules/nixos/common.nix | 15 ++++++++- modules/nixos/daniel.nix | 3 ++ modules/nixos/kde-plasma.nix | 4 +++ modules/nixos/valerie.nix | 32 ++++++++++++++++++ nixos/foxtrot.nix | 58 ++++++++++++++++++++++++++++++++- 9 files changed, 119 insertions(+), 31 deletions(-) create mode 100644 modules/nixos/valerie.nix diff --git a/flake.lock b/flake.lock index 7463be2..6ca3028 100644 --- a/flake.lock +++ b/flake.lock @@ -99,11 +99,11 @@ }, "hardware": { "locked": { - "lastModified": 1716173274, - "narHash": "sha256-FC21Bn4m6ctajMjiUof30awPBH/7WjD0M5yqrWepZbY=", + "lastModified": 1717995329, + "narHash": "sha256-lQJXEFHHVsFdFLx0bvoRbZH3IXUBsle6EWj9JroTJ/s=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "d9e0b26202fd500cf3e79f73653cce7f7d541191", + "rev": "58b52b0dd191af70f538c707c66c682331cfdffc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 732cece..d47076d 100644 --- a/flake.nix +++ b/flake.nix @@ -25,10 +25,7 @@ hyprland.url = "github:hyprwm/Hyprland"; - # ssbm.url = "github:lytedev/ssbm-nix"; - # ssbm.url = "git+file:///home/daniel/code/open-source/ssbm-nix"; slippi.url = "github:lytedev/slippi-nix"; - # slippi.url = "git+file:///home/daniel/code/open-source/slippi-nix"; }; outputs = { @@ -207,16 +204,14 @@ extra-substituters = [ "https://cache.nixos.org/" "https://helix.cachix.org" - "https://ssbm-nix.cachix.org" "https://nix-community.cachix.org" - "https://nix.h.lyte.dev" + # "https://nix.h.lyte.dev" "https://hyprland.cachix.org" ]; extra-trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "ssbm-nix.cachix.org-1:YN104LKAWaKQIecOphkftXgXlYZVK/IRHM1UD7WAIew=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" diff --git a/modules/home-manager/cargo.nix b/modules/home-manager/cargo.nix index 0ad1c45..12382da 100644 --- a/modules/home-manager/cargo.nix +++ b/modules/home-manager/cargo.nix @@ -1,9 +1,13 @@ {config, ...}: { - home.file."${config.xdg.configHome}/cargo/config.toml" = { + home.file."${config.home.homeDirectory}/.cargo/config.toml" = { enable = true; text = '' [build] rustdocflags = ["--default-theme=ayu"]; ''; }; + + # home.sessionVariables = { + # RUSTDOCFLAGS = "--default-theme=ayu"; + # }; } diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix index 413d14b..a68d1c4 100644 --- a/modules/home-manager/common.nix +++ b/modules/home-manager/common.nix @@ -7,9 +7,6 @@ config, ... }: { - # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module) - # TODO: wallpaper? - imports = with outputs.homeManagerModules; [ # nix-colors.homeManagerModules.default fish @@ -44,25 +41,9 @@ nil alejandra gnupg - - # common scripts - (pkgs.buildEnv { - name = "my-scripts-common"; - paths = [./scripts/common]; - }) ]; }; - # TODO: not common? - # programs.password-store = { - # enable = true; - # package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); - # }; - - # programs.gitui = { - # enable = true; - # }; - programs.direnv = { enable = true; nix-direnv.enable = true; diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index fb06411..1ac492a 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -96,6 +96,7 @@ in { ]; }; + users.groups.valerie = {}; users.groups.daniel = {}; users.users = { @@ -111,6 +112,18 @@ in { packages = []; }; + valerie = { + isNormalUser = true; + home = "/home/valerie"; + createHome = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev" + ]; + group = "valerie"; + extraGroups = ["users" "video"]; + packages = []; + }; + root = { openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys; }; @@ -290,7 +303,7 @@ in { "https://cache.nixos.org/" "https://helix.cachix.org" "https://nix-community.cachix.org" - "https://nix.h.lyte.dev" + # "https://nix.h.lyte.dev" ]; trusted-public-keys = [ diff --git a/modules/nixos/daniel.nix b/modules/nixos/daniel.nix index 0e4392a..17948ab 100644 --- a/modules/nixos/daniel.nix +++ b/modules/nixos/daniel.nix @@ -6,6 +6,9 @@ }: let inherit (pkgs) system; in { + # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module) + # TODO: wallpaper? + home-manager = { extraSpecialArgs = { inherit inputs outputs system; diff --git a/modules/nixos/kde-plasma.nix b/modules/nixos/kde-plasma.nix index d9599f6..5f06439 100644 --- a/modules/nixos/kde-plasma.nix +++ b/modules/nixos/kde-plasma.nix @@ -29,6 +29,10 @@ noto-fonts vlc wl-clipboard + + libsForQt5.qt5.qtvirtualkeyboard + maliit-keyboard + maliit-framework # libsForQt5.kate # libsForQt5.kdenlive # libsForQt5.merkuro diff --git a/modules/nixos/valerie.nix b/modules/nixos/valerie.nix new file mode 100644 index 0000000..5043b01 --- /dev/null +++ b/modules/nixos/valerie.nix @@ -0,0 +1,32 @@ +{ + pkgs, + inputs, + outputs, + ... +}: let + inherit (pkgs) system; +in { + home-manager = { + extraSpecialArgs = { + inherit inputs outputs system; + inherit (outputs) colors font; + }; + users.valerie = { + # accounts.email.accounts = { + # primary = { + # primary = true; + # address = ""; + # }; + # }; + + home = { + username = "valerie"; + homeDirectory = "/home/valerie"; + }; + + imports = with outputs.homeManagerModules; [ + common + ]; + }; + }; +} diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index d29cec5..4a06a29 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -1,5 +1,6 @@ { - # lib, + lib, + # config, inputs, outputs, pkgs, @@ -136,6 +137,10 @@ in { }; }; + home-manager.users.valerie = { + home.stateVersion = "24.05"; + }; + hardware.opengl.extraPackages = [ # pkgs.rocmPackages.clr.icd pkgs.amdvlk @@ -152,6 +157,56 @@ in { boot = { # kernelPackages = pkgs.linuxPackages_latest; + # https://github.com/void-linux/void-packages/issues/50417#issuecomment-2131802836 fix framework 13 not shutting down + kernelPatches = [ + { + name = "framework13shutdownfix"; + patch = '' + From 41d0d1b5b8bb1e6fbaf17ddbb654e6fa903eacdd Mon Sep 17 00:00:00 2001 + From: Mario Limonciello + Date: Sat, 25 May 2024 19:33:08 -0500 + Subject: [PATCH] Add hopefully a solution for shutdown regression + + --- + .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 20 ++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + + diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c + index 4abfcd32747d..636381121986 100644 + --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c + +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c + @@ -226,15 +226,17 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en) + struct amdgpu_device *adev = smu->adev; + int ret = 0; + + - if (!en && adev->in_s4) { + - /* Adds a GFX reset as workaround just before sending the + - * MP1_UNLOAD message to prevent GC/RLC/PMFW from entering + - * an invalid state. + - */ + - ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset, + - SMU_RESET_MODE_2, NULL); + - if (ret) + - return ret; + + if (!en && !adev->in_s0ix) { + + if (adev->in_s4) { + + /* Adds a GFX reset as workaround just before sending the + + * MP1_UNLOAD message to prevent GC/RLC/PMFW from entering + + * an invalid state. + + */ + + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset, + + SMU_RESET_MODE_2, NULL); + + if (ret) + + return ret; + + } + + ret = smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL); + } + -- + 2.43.0 + ''; + } + ]; loader = { efi.canTouchEfiVariables = true; @@ -227,6 +282,7 @@ in { networking.firewall.allowedTCPPorts = [ 8000 # dev stuff + 7777 ]; system.stateVersion = "24.05";