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

View file

@ -1,10 +1,26 @@
{ {
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,
endless-sky,
flake-compat,
flake-utils,
helix,
home-manager,
nil,
nix-ld,
nixos-hardware,
nixpkgs-master,
nixpkgs-nixos-unstable,
nixpkgs-rust-analyzer,
nixpkgs-stable,
nur,
self,
sops,
} @ inputs: let
mkServer = pkgs: system: hostname: mkServer = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
inherit system; inherit system;
@ -13,19 +29,18 @@
(import ./nixos/server-common.nix) (import ./nixos/server-common.nix)
sops.nixosModules.sops sops.nixosModules.sops
disko.nixosModules.disko disko.nixosModules.disko
({ pkgs, ... }: { ({pkgs, ...}: {
nixpkgs.overlays = [ inputs.cryptpad.overlays.default ]; nixpkgs.overlays = [inputs.cryptpad.overlays.default];
}) })
inputs.cryptpad.nixosModules.cryptpad inputs.cryptpad.nixosModules.cryptpad
]; ];
specialArgs = { inherit inputs system; }; specialArgs = {inherit inputs system;};
}; };
mkRaspi = pkgs: hostname: mkRaspi = pkgs: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = modules = [(./. + "/nixos/boxes/${hostname}") sops.nixosModules.sops];
[ (./. + "/nixos/boxes/${hostname}") sops.nixosModules.sops ]; specialArgs = {inherit inputs;};
specialArgs = { inherit inputs; };
}; };
mkKiosk = pkgs: system: hostname: mkKiosk = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
@ -40,8 +55,7 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = imports = [./nixos/home-manager ./nixos/home-manager/linux.nix];
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
@ -51,11 +65,11 @@
inherit inputs system; inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable { nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {allowUnfree = true;};
}; };
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {allowUnfree = true;};
}; };
}; };
}; };
@ -69,14 +83,13 @@
sops.nixosModules.sops sops.nixosModules.sops
disko.nixosModules.disko disko.nixosModules.disko
nix-ld.nixosModules.nix-ld nix-ld.nixosModules.nix-ld
{ programs.nix-ld.dev.enable = true; } {programs.nix-ld.dev.enable = true;}
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = imports = [./nixos/home-manager ./nixos/home-manager/linux.nix];
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
@ -86,19 +99,20 @@
inherit inputs system; inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable { nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {allowUnfree = true;};
}; };
nixpkgs-nixos-unstable = nixpkgs-nixos-unstable =
import nixpkgs-nixos-unstable { inherit system; }; import nixpkgs-nixos-unstable {inherit system;};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {allowUnfree = true;};
}; };
}; };
}; };
mkShell = packageSet: system: mkShell = packageSet: system: let
let pkgs = packageSet.legacyPackages.${system}; pkgs = packageSet.legacyPackages.${system};
in pkgs.mkShell { in
pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
inputs.alejandra.defaultPackage.${system} inputs.alejandra.defaultPackage.${system}
cacert cacert
@ -115,6 +129,7 @@
devShells = { devShells = {
"x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin"; "x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin";
"x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux"; "x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux";
"aarch64-linux".default = mkShell nixpkgs-stable "aarch64-linux";
}; };
darwinConfigurations = { darwinConfigurations = {
"FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec { "FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec {
@ -126,7 +141,7 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [ ./nixos/home-manager ]; imports = [./nixos/home-manager];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
@ -146,12 +161,12 @@
bootstrap = nixpkgs-stable.lib.nixosSystem rec { bootstrap = nixpkgs-stable.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ (./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops ]; modules = [(./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops];
specialArgs = { specialArgs = {
inherit inputs system; inherit inputs system;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {allowUnfree = true;};
}; };
}; };
}; };
@ -164,8 +179,7 @@
(import (import
"${inputs.nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix") "${inputs.nixpkgs-stable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{ {
environment.systemPackages = environment.systemPackages = with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
neovim neovim
htop htop
btop btop
@ -197,7 +211,7 @@
console.earlySetup = true; console.earlySetup = true;
} }
]; ];
specialArgs = { inherit inputs; }; specialArgs = {inherit inputs;};
}; };
}; };
}; };
@ -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";