From 65631fe7158253199eb7d1ad180d17e4d9d57704 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Thu, 15 Aug 2024 09:30:14 +0200 Subject: [PATCH] feat: add support for Guix --- home/default.nix | 1 + nixos/hosts/laptop-phobos/default.nix | 36 +++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/home/default.nix b/home/default.nix index cfdbc3f..82dcc62 100644 --- a/home/default.nix +++ b/home/default.nix @@ -53,6 +53,7 @@ in { }; xdg = { + enable = true; userDirs = let dir = s: "${config.home.homeDirectory}/${s}"; in { enable = true; documents = dir "doc"; diff --git a/nixos/hosts/laptop-phobos/default.nix b/nixos/hosts/laptop-phobos/default.nix index 6ddb869..633d63f 100644 --- a/nixos/hosts/laptop-phobos/default.nix +++ b/nixos/hosts/laptop-phobos/default.nix @@ -35,6 +35,24 @@ keyboards = [ "moonlander" ]; }; + environment.sessionVariables = { + # TODO this is a temporary solution until the Guix module + # is fixed in nixpkgs! + XDG_CONFIG_HOME = "$HOME/.config"; + }; + services.guix = { + enable = true; + + # Hacky, yes. + package = pkgs.callPackage ({ stateDir, storeDir }: pkgs.symlinkJoin { + name = "guix-without-info"; + paths = [ (pkgs.guix.override { inherit stateDir storeDir; }) ]; + postBuild = '' + rm -rf $out/share/info + ''; + }) { stateDir = "/var"; storeDir = "/gnu/store"; }; + }; + networking.hostName = "laptop-phobos"; boot = { # Boot options @@ -42,19 +60,27 @@ initrd.kernelModules = [ "amdgpu" ]; # Secure boot - lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; + # lanzaboote = { + # enable = true; + # pkiBundle = "/etc/secureboot"; + # }; loader = { # EFI Boot efi = { canTouchEfiVariables = true; }; systemd-boot = { - enable = lib.mkForce false; # lanzaboote is used instead + enable = true; # lanzaboote is used instead editor = false; # Better security, disallows passing /bin/sh to start as root configurationLimit = 5; + + extraEntries = { + "guix-grub.conf" = '' + title Guix (grub) + efi /efi/Guix/grubx64.efi + sort-key a_grub + ''; + }; }; timeout = 0; }; -- 2.48.1