support aarch64-linux shells
Some checks failed
use nix / build (push) Failing after 3m13s

This commit is contained in:
Cyryl Płotnicki 2024-04-21 18:17:38 +01:00
parent ae6ea8fe04
commit 83c99fde4b

402
flake.nix
View file

@ -1,206 +1,220 @@
{ {
description = "NixOS configuration with flakes"; description = "NixOS configuration with flakes";
outputs = { alejandra, cryptpad, darwin, disko, endless-sky, flake-compat outputs = {
, flake-utils, helix, home-manager, nil, nix-ld, nixos-hardware alejandra,
, nixpkgs-master, nixpkgs-nixos-unstable, nixpkgs-rust-analyzer cryptpad,
, nixpkgs-stable, nur, self, sops, }@inputs: darwin,
let disko,
mkServer = pkgs: system: hostname: endless-sky,
pkgs.lib.nixosSystem { flake-compat,
inherit system; flake-utils,
modules = [ helix,
(./. + "/nixos/boxes/${hostname}") home-manager,
(import ./nixos/server-common.nix) nil,
sops.nixosModules.sops nix-ld,
disko.nixosModules.disko nixos-hardware,
({ pkgs, ... }: { nixpkgs-master,
nixpkgs.overlays = [ inputs.cryptpad.overlays.default ]; nixpkgs-nixos-unstable,
}) nixpkgs-rust-analyzer,
inputs.cryptpad.nixosModules.cryptpad nixpkgs-stable,
]; nur,
specialArgs = { inherit inputs system; }; self,
}; sops,
mkRaspi = pkgs: hostname: } @ inputs: let
pkgs.lib.nixosSystem { mkServer = pkgs: system: hostname:
system = "aarch64-linux"; pkgs.lib.nixosSystem {
modules = inherit system;
[ (./. + "/nixos/boxes/${hostname}") sops.nixosModules.sops ]; modules = [
specialArgs = { inherit inputs; }; (./. + "/nixos/boxes/${hostname}")
}; (import ./nixos/server-common.nix)
mkKiosk = pkgs: system: hostname: sops.nixosModules.sops
pkgs.lib.nixosSystem { disko.nixosModules.disko
inherit system; ({pkgs, ...}: {
modules = [ nixpkgs.overlays = [inputs.cryptpad.overlays.default];
(./. + "/nixos/boxes/${hostname}") })
(import ./nixos/common.nix) inputs.cryptpad.nixosModules.cryptpad
sops.nixosModules.sops ];
specialArgs = {inherit inputs system;};
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports =
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = { allowUnfree = true; };
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
};
};
};
mkWorkstation = pkgs: system: hostname:
pkgs.lib.nixosSystem {
inherit system;
modules = [
(./. + "/nixos/boxes/${hostname}")
(import ./nixos/email-accounts.nix)
(import ./nixos/common.nix)
sops.nixosModules.sops
disko.nixosModules.disko
nix-ld.nixosModules.nix-ld
{ programs.nix-ld.dev.enable = true; }
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports =
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = { allowUnfree = true; };
};
nixpkgs-nixos-unstable =
import nixpkgs-nixos-unstable { inherit system; };
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
};
};
};
mkShell = packageSet: system:
let pkgs = packageSet.legacyPackages.${system};
in pkgs.mkShell {
packages = with pkgs; [
inputs.alejandra.defaultPackage.${system}
cacert
git
git-lfs
nixpkgs-fmt
openssh
openssl
pkg-config
statix
];
};
in {
devShells = {
"x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin";
"x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux";
}; };
darwinConfigurations = { mkRaspi = pkgs: hostname:
"FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec { pkgs.lib.nixosSystem {
system = "x86_64-darwin"; system = "aarch64-linux";
modules = [ modules = [(./. + "/nixos/boxes/${hostname}") sops.nixosModules.sops];
(./. + "/nixos/boxes/form3") specialArgs = {inherit inputs;};
home-manager.darwinModules.home-manager };
{ mkKiosk = pkgs: system: hostname:
home-manager.useGlobalPkgs = true; pkgs.lib.nixosSystem {
home-manager.useUserPackages = true; inherit system;
home-manager.users.cyryl = { modules = [
imports = [ ./nixos/home-manager ]; (./. + "/nixos/boxes/${hostname}")
_module.args.inputs = inputs; (import ./nixos/common.nix)
_module.args.system = system; sops.nixosModules.sops
};
} home-manager.nixosModules.home-manager
]; {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix];
_module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = {allowUnfree = true;};
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
};
}; };
}; };
mkWorkstation = pkgs: system: hostname:
nixosConfigurations = { pkgs.lib.nixosSystem {
foryog = mkWorkstation nixpkgs-nixos-unstable "x86_64-linux" "foryog"; inherit system;
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky"; modules = [
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty"; (./. + "/nixos/boxes/${hostname}")
vpsfree1 = mkServer nixpkgs-stable "x86_64-linux" "vpsfree1"; (import ./nixos/email-accounts.nix)
cupsnet = mkServer nixpkgs-stable "aarch64-linux" "cupsnet"; (import ./nixos/common.nix)
mb1 = mkServer nixpkgs-stable "x86_64-linux" "mb1"; sops.nixosModules.sops
homescreen = mkRaspi nixpkgs-stable "homescreen"; disko.nixosModules.disko
nix-ld.nixosModules.nix-ld
bootstrap = nixpkgs-stable.lib.nixosSystem rec { {programs.nix-ld.dev.enable = true;}
system = "x86_64-linux"; home-manager.nixosModules.home-manager
modules = [ (./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops ]; {
specialArgs = { home-manager.useGlobalPkgs = true;
inherit inputs system; home-manager.useUserPackages = true;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { home-manager.users.cyryl = {
inherit system; imports = [./nixos/home-manager ./nixos/home-manager/linux.nix];
config = { allowUnfree = true; }; _module.args.inputs = inputs;
_module.args.system = system;
}; };
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = {allowUnfree = true;};
};
nixpkgs-nixos-unstable =
import nixpkgs-nixos-unstable {inherit system;};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
}; };
}; };
# nix build .#nixosConfigurations.raspiimage.config.system.build.sdImage };
# sudo dd if=result/sd-image/nixos-sd-image-21.11.20211201.a640d83-aarch64-linux.img of=/dev/sda bs=4M conv=fsync status=progress mkShell = packageSet: system: let
# make sure to update eeprom https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_4#Board-specific_installation_notes pkgs = packageSet.legacyPackages.${system};
raspiimage = nixpkgs-stable.lib.nixosSystem { in
system = "aarch64-linux"; pkgs.mkShell {
modules = [ packages = with pkgs; [
(import inputs.alejandra.defaultPackage.${system}
"${inputs.nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix") cacert
{ git
environment.systemPackages = git-lfs
with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [ nixpkgs-fmt
neovim openssh
htop openssl
btop pkg-config
atop statix
]; ];
};
networking.networkmanager.enable = false; in {
hardware.enableRedistributableFirmware = true; devShells = {
networking.wireless.enable = true; "x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin";
"x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux";
services.openssh = { "aarch64-linux".default = mkShell nixpkgs-stable "aarch64-linux";
enable = true; };
permitRootLogin = darwinConfigurations = {
nixpkgs-stable.lib.mkForce "prohibit-password"; "FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec {
passwordAuthentication = false; system = "x86_64-darwin";
}; modules = [
(./. + "/nixos/boxes/form3")
services.xserver = { home-manager.darwinModules.home-manager
enable = true; {
displayManager.lightdm.enable = true; home-manager.useGlobalPkgs = true;
desktopManager.gnome.enable = true; home-manager.useUserPackages = true;
libinput.enable = true; home-manager.users.cyryl = {
}; imports = [./nixos/home-manager];
_module.args.inputs = inputs;
users.extraUsers.root.openssh.authorizedKeys.keys = [ _module.args.system = system;
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty" };
]; }
sdImage.compressImage = false; ];
console.earlySetup = true;
}
];
specialArgs = { inherit inputs; };
};
}; };
}; };
nixosConfigurations = {
foryog = mkWorkstation nixpkgs-nixos-unstable "x86_64-linux" "foryog";
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty";
vpsfree1 = mkServer nixpkgs-stable "x86_64-linux" "vpsfree1";
cupsnet = mkServer nixpkgs-stable "aarch64-linux" "cupsnet";
mb1 = mkServer nixpkgs-stable "x86_64-linux" "mb1";
homescreen = mkRaspi nixpkgs-stable "homescreen";
bootstrap = nixpkgs-stable.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [(./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
};
};
};
# nix build .#nixosConfigurations.raspiimage.config.system.build.sdImage
# sudo dd if=result/sd-image/nixos-sd-image-21.11.20211201.a640d83-aarch64-linux.img of=/dev/sda bs=4M conv=fsync status=progress
# make sure to update eeprom https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_4#Board-specific_installation_notes
raspiimage = nixpkgs-stable.lib.nixosSystem {
system = "aarch64-linux";
modules = [
(import
"${inputs.nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{
environment.systemPackages = with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
neovim
htop
btop
atop
];
networking.networkmanager.enable = false;
hardware.enableRedistributableFirmware = true;
networking.wireless.enable = true;
services.openssh = {
enable = true;
permitRootLogin =
nixpkgs-stable.lib.mkForce "prohibit-password";
passwordAuthentication = false;
};
services.xserver = {
enable = true;
displayManager.lightdm.enable = true;
desktopManager.gnome.enable = true;
libinput.enable = true;
};
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty"
];
sdImage.compressImage = false;
console.earlySetup = true;
}
];
specialArgs = {inherit inputs;};
};
};
};
inputs = { inputs = {
nixpkgs-master = { nixpkgs-master = {
type = "github"; type = "github";
@ -301,7 +315,7 @@
}; };
cryptpad = { cryptpad = {
url = "github:michaelshmitty/cryptpad-flake"; url = "github:michaelshmitty/cryptpad-flake";
inputs = { nixpkgs.follows = "nixpkgs-stable"; }; inputs = {nixpkgs.follows = "nixpkgs-stable";};
}; };
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";