change cross compiling

This commit is contained in:
Patrick Neff 2025-01-08 23:45:02 +01:00
parent b9dfbdcc73
commit 6d9f22f8f3
13 changed files with 72 additions and 72 deletions

View File

@ -166,7 +166,6 @@
url = "github:nix-community/NixOS-WSL";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
};
};

View File

@ -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;

View File

@ -1,7 +1,7 @@
_: {
programs = {
yazi = {
enable = true;
enable = false;
enableZshIntegration = true;
};
};

View File

@ -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
'';
*/
};
}

View File

@ -4,8 +4,8 @@
};
config = lib.mkIf config.hardware.raspberry-pi.enable {
environment.systemPackages = with pkgs; [
#libraspberrypi
#raspberrypi-eeprom
libraspberrypi
raspberrypi-eeprom
];
};
}

View File

@ -2,7 +2,7 @@ _:
{
imports = [
./kodi
./jellyfin
#./jellyfin
./gokosync
];
}

View File

@ -57,12 +57,14 @@
{
plugin = neorg-telescope;
}
/*
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "guihua";
src = inputs.guihua;
};
}
*/
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "luavit-meta";

View File

@ -14,6 +14,6 @@
};
};
};
crates-nvim.enable = true;
crates.enable = true;
};
}

View File

@ -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
];
};
}

View File

@ -1,7 +1,6 @@
{ outputs, ... }: {
imports = [
outputs.homeManagerModules.base
outputs.homeManagerModules.shell
outputs.homeManagerModules.user
];
}

View File

@ -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
];

View File

@ -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";
}

View File

@ -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