From 6d9f22f8f3dc9f93ff90b2de90b69267b69416a8 Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Wed, 8 Jan 2025 23:45:02 +0100 Subject: [PATCH] change cross compiling --- flake.nix | 1 - modules/home-manager/games/default.nix | 2 +- modules/home-manager/shell/yazi/default.nix | 2 +- modules/nixos/base/nixos/default.nix | 95 ++++++++++--------- modules/nixos/base/raspberry-pi/default.nix | 4 +- modules/nixos/mediacenter/default.nix | 2 +- modules/nixvim/default.nix | 2 + modules/nixvim/plugins/lsp/languages/rust.nix | 2 +- profiles/home-manager/odie@asgard/home.nix | 6 +- profiles/home-manager/odie@pi0/home.nix | 1 - profiles/nixos/pi0/configuration.nix | 14 +-- profiles/nixos/pi0/hardware-configuration.nix | 5 +- remote-deploy.sh | 8 +- 13 files changed, 72 insertions(+), 72 deletions(-) diff --git a/flake.nix b/flake.nix index 920095a..4766eb3 100644 --- a/flake.nix +++ b/flake.nix @@ -166,7 +166,6 @@ url = "github:nix-community/NixOS-WSL"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; flake-compat.follows = "flake-compat"; }; }; diff --git a/modules/home-manager/games/default.nix b/modules/home-manager/games/default.nix index f3864c4..d8d0309 100644 --- a/modules/home-manager/games/default.nix +++ b/modules/home-manager/games/default.nix @@ -8,7 +8,7 @@ with lib; { config = { games = { - unnethack.enable = mkDefault true; + unnethack.enable = mkDefault false; dsda-doom.enable = mkDefault true; woof.enable = mkDefault true; eternity.enable = mkDefault true; diff --git a/modules/home-manager/shell/yazi/default.nix b/modules/home-manager/shell/yazi/default.nix index 3f44a02..8cc2ffc 100644 --- a/modules/home-manager/shell/yazi/default.nix +++ b/modules/home-manager/shell/yazi/default.nix @@ -1,7 +1,7 @@ _: { programs = { yazi = { - enable = true; + enable = false; enableZshIntegration = true; }; }; diff --git a/modules/nixos/base/nixos/default.nix b/modules/nixos/base/nixos/default.nix index 5c44b3b..6d8758f 100644 --- a/modules/nixos/base/nixos/default.nix +++ b/modules/nixos/base/nixos/default.nix @@ -1,51 +1,58 @@ -{ inputs, overlays, ... }: { +{ inputs, overlays, lib, config, ... }: { nixpkgs = { config.allowUnfree = true; inherit overlays; }; - nix = { - registry.nixpkgs.flake = inputs.nixpkgs; - optimise = { - automatic = true; - }; - settings = { - trusted-users = [ "root" "@wheel" ]; - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - substituters = [ - #"http://nix-cache.gaja-group.intranet:5000" - "https://nix-community.cachix.org" - ]; - trusted-public-keys = [ - #"nix-cache.gaja-group.intranet:EcUsafvI9NUrnab3DA71s2PGjAYMgct0FOvCwdYuStw=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + nix = + let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in + { + optimise = { + automatic = true; + }; + channel.enable = false; + + registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + settings = { + trusted-users = [ "root" "@wheel" ]; + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + substituters = [ + "http://nix-cache.gaja-group.intranet:5000" + "https://nix-community.cachix.org" + "https://cache.nixos.org" + ]; + trusted-public-keys = [ + "nix-cache.gaja-group.intranet:EcUsafvI9NUrnab3DA71s2PGjAYMgct0FOvCwdYuStw=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + inherit (config.nix) nixPath; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + buildMachines = [ + { + hostName = "nix-cache.gaja-group.intranet"; + #system = "x86_64-linux"; + protocol = "ssh-ng"; + # if the builder supports building for multiple architectures, + # replace the previous line by, e.g., + systems = [ "x86_64-linux" "aarch64-linux" ]; + maxJobs = 4; + speedFactor = 2; + supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + mandatoryFeatures = [ ]; + } ]; + distributedBuilds = true; + # optional, useful when the builder has a faster internet connection than yours + extraOptions = '' + builders-use-substitutes = true + ''; }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - /* - buildMachines = [ - { - hostName = "nix-cache.gaja-group.intranet"; - #system = "x86_64-linux"; - protocol = "ssh-ng"; - # if the builder supports building for multiple architectures, - # replace the previous line by, e.g., - systems = [ "x86_64-linux" "aarch64-linux" ]; - maxJobs = 4; - speedFactor = 1; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - mandatoryFeatures = [ ]; - } - ]; - distributedBuilds = true; - # optional, useful when the builder has a faster internet connection than yours - extraOptions = '' - builders-use-substitutes = true - ''; - */ - }; } diff --git a/modules/nixos/base/raspberry-pi/default.nix b/modules/nixos/base/raspberry-pi/default.nix index f9a8744..2575c2a 100644 --- a/modules/nixos/base/raspberry-pi/default.nix +++ b/modules/nixos/base/raspberry-pi/default.nix @@ -4,8 +4,8 @@ }; config = lib.mkIf config.hardware.raspberry-pi.enable { environment.systemPackages = with pkgs; [ - #libraspberrypi - #raspberrypi-eeprom + libraspberrypi + raspberrypi-eeprom ]; }; } diff --git a/modules/nixos/mediacenter/default.nix b/modules/nixos/mediacenter/default.nix index a32df78..ec617cc 100644 --- a/modules/nixos/mediacenter/default.nix +++ b/modules/nixos/mediacenter/default.nix @@ -2,7 +2,7 @@ _: { imports = [ ./kodi - ./jellyfin + #./jellyfin ./gokosync ]; } diff --git a/modules/nixvim/default.nix b/modules/nixvim/default.nix index 5d3fcb5..453b2c5 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -57,12 +57,14 @@ { plugin = neorg-telescope; } + /* { plugin = pkgs.vimUtils.buildVimPlugin { name = "guihua"; src = inputs.guihua; }; } + */ { plugin = pkgs.vimUtils.buildVimPlugin { name = "luavit-meta"; diff --git a/modules/nixvim/plugins/lsp/languages/rust.nix b/modules/nixvim/plugins/lsp/languages/rust.nix index 84909e8..bd73a9e 100644 --- a/modules/nixvim/plugins/lsp/languages/rust.nix +++ b/modules/nixvim/plugins/lsp/languages/rust.nix @@ -14,6 +14,6 @@ }; }; }; - crates-nvim.enable = true; + crates.enable = true; }; } diff --git a/profiles/home-manager/odie@asgard/home.nix b/profiles/home-manager/odie@asgard/home.nix index bbca918..4e6d8c0 100644 --- a/profiles/home-manager/odie@asgard/home.nix +++ b/profiles/home-manager/odie@asgard/home.nix @@ -1,5 +1,4 @@ -{ pkgs -, inputs +{ inputs , outputs , vars , ... @@ -40,8 +39,5 @@ sessionVariables = { PATH = "/home/${vars.username}/bin:$PATH"; }; - packages = with pkgs; [ - nix-serve - ]; }; } diff --git a/profiles/home-manager/odie@pi0/home.nix b/profiles/home-manager/odie@pi0/home.nix index e05e232..dfead50 100644 --- a/profiles/home-manager/odie@pi0/home.nix +++ b/profiles/home-manager/odie@pi0/home.nix @@ -1,7 +1,6 @@ { outputs, ... }: { imports = [ outputs.homeManagerModules.base - outputs.homeManagerModules.shell outputs.homeManagerModules.user ]; } diff --git a/profiles/nixos/pi0/configuration.nix b/profiles/nixos/pi0/configuration.nix index 4f2f410..69eef4e 100644 --- a/profiles/nixos/pi0/configuration.nix +++ b/profiles/nixos/pi0/configuration.nix @@ -19,26 +19,23 @@ let in { imports = [ - inputs.nixos-hardware.nixosModules.raspberry-pi-4 + #inputs.nixos-hardware.nixosModules.raspberry-pi-4 outputs.nixosModules.base outputs.nixosModules.home-manager outputs.nixosModules.mediacenter outputs.nixosModules.sops outputs.nixosModules.raspberry-pi ./hardware-configuration.nix - ] ++ map (name: (import ../../../lib/genSslCert.nix { + ] + ++ map (name: (import ../../../lib/genSslCert.nix { inherit name; inherit (config.services.haproxy) user; dataDir = haproxy.certDir; domain = name; wantedBy = [ "haproxy.service" ]; Before = [ "haproxy.service" ]; - })) haproxy.domains; - - nixpkgs.crossSystem = { - # target platform - system = "riscv64-linux"; - }; + })) haproxy.domains + ; networking = { inherit (vars) hostName domain; @@ -71,7 +68,6 @@ in libraspberrypi raspberrypi-eeprom libcec - kitty nfs-utils ]; diff --git a/profiles/nixos/pi0/hardware-configuration.nix b/profiles/nixos/pi0/hardware-configuration.nix index 94b894b..cc00714 100644 --- a/profiles/nixos/pi0/hardware-configuration.nix +++ b/profiles/nixos/pi0/hardware-configuration.nix @@ -87,7 +87,8 @@ }; }; }; - system.stateVersion = "23.11"; + system.stateVersion = "25.05"; - #nixpkgs.hostPlatform.system = "aarch64-linux"; + nixpkgs.hostPlatform.system = "aarch64-linux"; + #nixpkgs.buildPlatform.system = "x86_64-linux"; } diff --git a/remote-deploy.sh b/remote-deploy.sh index faa5cad..8948233 100755 --- a/remote-deploy.sh +++ b/remote-deploy.sh @@ -4,7 +4,7 @@ set -e HOSTNAME=$1 -nix build -L ".#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel" -nix copy --no-check-sigs --to "ssh-ng://root@${HOSTNAME}" "./result" -ssh "root@${HOSTNAME}" nix-env -p /nix/var/nix/profiles/system --set "$(readlink ./result)" -ssh "root@${HOSTNAME}" /nix/var/nix/profiles/system/bin/switch-to-configuration switch +GC_FORCE_UNMAP_ON_GCOLLECT=1 nix build ".#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel" +#nix copy --no-check-sigs --to "ssh-ng://root@${HOSTNAME}" "./result" +#ssh "root@${HOSTNAME}" nix-env -p /nix/var/nix/profiles/system --set "$(readlink ./result)" +#ssh "root@${HOSTNAME}" /nix/var/nix/profiles/system/bin/switch-to-configuration switch