Format
All checks were successful
/ test (push) Successful in 1m25s

This commit is contained in:
Andrea Ciceri 2024-11-08 10:24:16 +01:00
parent 43c06ae4c4
commit 8b7d68b296
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
7 changed files with 310 additions and 224 deletions

View file

@ -1,7 +1,18 @@
{ inputs, self, lib, ... }: { {
imports = [ inputs.treefmt-nix.flakeModule inputs.git-hooks-nix.flakeModule ]; inputs,
self,
lib,
...
}:
{
imports = [
inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule
];
perSystem = { ... }: { perSystem =
{ ... }:
{
treefmt.config = { treefmt.config = {
projectRootFile = ".git/config"; projectRootFile = ".git/config";
programs = { programs = {
@ -16,10 +27,12 @@
}; };
}; };
flake.checks = let build = _: nc: nc.config.system.build.toplevel; flake.checks =
in { let
x86_64-linux = build = _: nc: nc.config.system.build.toplevel;
lib.mapAttrs build { inherit (self.nixosConfigurations) picard; }; in
{
x86_64-linux = lib.mapAttrs build { inherit (self.nixosConfigurations) picard; };
aarch64-linux = lib.mapAttrs build { aarch64-linux = lib.mapAttrs build {
inherit (self.nixosConfigurations) sisko; # pbp; inherit (self.nixosConfigurations) sisko; # pbp;
}; };

View file

@ -1,6 +1,5 @@
{ {
description = description = "A complete, declarative, and reproducible configuration of my entire Nix fleet";
"A complete, declarative, and reproducible configuration of my entire Nix fleet";
inputs = { inputs = {
flakeParts.url = "github:hercules-ci/flake-parts"; flakeParts.url = "github:hercules-ci/flake-parts";
@ -34,11 +33,12 @@
url = "github:MatthewCroughan/NixThePlanet/"; url = "github:MatthewCroughan/NixThePlanet/";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixDarwin = { url = "github:LnL7/nix-darwin"; }; nixDarwin = {
url = "github:LnL7/nix-darwin";
};
nix-on-droid.url = "github:nix-community/nix-on-droid"; nix-on-droid.url = "github:nix-community/nix-on-droid";
lix = { lix = {
url = url = "git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update
"git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update
flake = false; flake = false;
}; };
lix-module = { lix-module = {
@ -65,7 +65,8 @@
emacs-overlay.url = "github:nix-community/emacs-overlay"; emacs-overlay.url = "github:nix-community/emacs-overlay";
}; };
outputs = inputs@{ flakeParts, ... }: outputs =
inputs@{ flakeParts, ... }:
flakeParts.lib.mkFlake { inherit inputs; } { flakeParts.lib.mkFlake { inherit inputs; } {
imports = [ imports = [
# TODO export modules as flake outputs # TODO export modules as flake outputs
@ -76,6 +77,9 @@
./shell ./shell
./checks ./checks
]; ];
systems = [ "x86_64-linux" "aarch64-linux" ]; systems = [
"x86_64-linux"
"aarch64-linux"
];
}; };
} }

View file

@ -16,7 +16,8 @@ let
fi fi
fi fi
''; '';
in { in
{
imports = [ imports = [
./hyprpaper.nix ./hyprpaper.nix
../waybar ../waybar
@ -38,7 +39,9 @@ in {
brightnessctl brightnessctl
]; ];
systemd.user.sessionVariables = { NIXOS_OZONE_WL = "1"; }; systemd.user.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
services.network-manager-applet.enable = true; services.network-manager-applet.enable = true;
services.blueman-applet.enable = true; services.blueman-applet.enable = true;
@ -61,7 +64,9 @@ in {
}; };
}; };
qt = { enable = true; }; qt = {
enable = true;
};
# services.kanshi = { # services.kanshi = {
# enable = true; # enable = true;
@ -91,14 +96,16 @@ in {
# }; # };
home.file.".icons/catppuccin-mocha-sapphire" = { home.file.".icons/catppuccin-mocha-sapphire" = {
source = source = "${pkgs.catppuccin-cursors.mochaSapphire}/share/icons/catppuccin-mocha-sapphire-cursors";
"${pkgs.catppuccin-cursors.mochaSapphire}/share/icons/catppuccin-mocha-sapphire-cursors";
recursive = true; recursive = true;
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
plugins = with pkgs.hyprlandPlugins; [ hy3 hyprspace ]; plugins = with pkgs.hyprlandPlugins; [
hy3
hyprspace
];
# TODO migrate to structured options # TODO migrate to structured options
extraConfig = builtins.readFile ./hyprland.conf; extraConfig = builtins.readFile ./hyprland.conf;
}; };

View file

@ -1,5 +1,12 @@
{ fleetModules, lib, pkgs, ... }: { {
imports = fleetModules [ fleetModules,
lib,
pkgs,
...
}:
{
imports =
fleetModules [
"common" "common"
"ssh" "ssh"
"ccr" "ccr"
@ -28,7 +35,8 @@
"prometheus-exporters" "prometheus-exporters"
"promtail" "promtail"
"syncthing" "syncthing"
] ++ [ ./disko.nix ]; ]
++ [ ./disko.nix ];
ccr = { ccr = {
enable = true; enable = true;
@ -70,8 +78,12 @@
}; };
boot.initrd.kernelModules = [ "i915" ]; boot.initrd.kernelModules = [ "i915" ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules = [
[ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; "nvme"
"xhci_pci"
"usb_storage"
"sd_mod"
];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.kernelPackages = pkgs.linuxPackages; boot.kernelPackages = pkgs.linuxPackages;

View file

@ -1,5 +1,13 @@
{ fleetModules, lib, config, pkgs, ... }: { {
imports = fleetModules [ fleetModules,
lib,
config,
pkgs,
...
}:
{
imports =
fleetModules [
"common" "common"
"ssh" "ssh"
"ccr" "ccr"
@ -34,7 +42,8 @@
"guix" "guix"
"prometheus-exporters" "prometheus-exporters"
"promtail" "promtail"
] ++ [ ./disko.nix ]; ]
++ [ ./disko.nix ];
ccr = { ccr = {
enable = true; enable = true;
@ -88,8 +97,13 @@
boot.kernelParams = [ "ip=dhcp" ]; boot.kernelParams = [ "ip=dhcp" ];
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules = [
[ "nvme" "xhci_pci" "ahci" "usbhid" "r8169" ]; "nvme"
"xhci_pci"
"ahci"
"usbhid"
"r8169"
];
boot.kernelModules = [ boot.kernelModules = [
"kvm-amd" "kvm-amd"
"ddcci" "ddcci"
@ -138,8 +152,7 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil"; powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil";
hardware.cpu.amd.updateMicrocode = hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.enableRedistributableFirmware = lib.mkDefault true; hardware.enableRedistributableFirmware = lib.mkDefault true;
hardware.graphics = { hardware.graphics = {

View file

@ -1,9 +1,13 @@
{ config, lib, fleetFlake, ... }: { {
config,
lib,
fleetFlake,
...
}:
{
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: _: { (final: _: {
nix-eval-job = nix-eval-job = fleetFlake.inputs.lix-eval-jobs.packages.${final.system}.nix-eval-jobs // {
fleetFlake.inputs.lix-eval-jobs.packages.${final.system}.nix-eval-jobs
// {
nix = final.nix; nix = final.nix;
}; };
}) })
@ -17,7 +21,10 @@
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;
trusted-users = [ "root" "@wheel" ]; trusted-users = [
"root"
"@wheel"
];
netrc-file = "/etc/nix/netrc"; netrc-file = "/etc/nix/netrc";
substituters = [ substituters = [
# "s3://cache?profile=default&region=eu-south-1&scheme=https&endpoint=cache.aciceri.dev" # "s3://cache?profile=default&region=eu-south-1&scheme=https&endpoint=cache.aciceri.dev"
@ -49,7 +56,8 @@
options = "--delete-older-than 180d"; options = "--delete-older-than 180d";
}; };
registry = lib.mkForce ({ registry = lib.mkForce (
{
nixpkgs.to = { nixpkgs.to = {
type = "path"; type = "path";
path = fleetFlake.inputs.nixpkgs; path = fleetFlake.inputs.nixpkgs;
@ -58,7 +66,8 @@
type = "path"; type = "path";
path = fleetFlake.inputs.nixpkgs; path = fleetFlake.inputs.nixpkgs;
}; };
} // (lib.optionalAttrs (builtins.hasAttr "ccr" config) { }
// (lib.optionalAttrs (builtins.hasAttr "ccr" config) {
nixfleet.to = { nixfleet.to = {
type = "path"; type = "path";
path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; path = "/home/${config.ccr.username}/projects/aciceri/nixfleet";
@ -71,7 +80,8 @@
type = "path"; type = "path";
path = "/home/${config.ccr.username}/.config/emacs"; path = "/home/${config.ccr.username}/.config/emacs";
}; };
})); })
);
distributedBuilds = true; distributedBuilds = true;
buildMachines = buildMachines =
@ -79,16 +89,26 @@
hostName = "sisko.fleet"; hostName = "sisko.fleet";
system = "aarch64-linux"; system = "aarch64-linux";
maxJobs = 7; maxJobs = 7;
supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; supportedFeatures = [
"kvm"
"nixos-test"
"big-parallel"
"benchmark"
];
protocol = "ssh-ng"; protocol = "ssh-ng";
sshUser = "root"; sshUser = "root";
sshKey = "/home/${config.ccr.username}/.ssh/id_rsa"; sshKey = "/home/${config.ccr.username}/.ssh/id_rsa";
} ++ (lib.lists.optional (config.networking.hostName == "picard") { }
hostName = ++ (lib.lists.optional (config.networking.hostName == "picard") {
"mac.staging.mlabs.city?remote-program=/run/current-system/sw/bin/nix-store"; hostName = "mac.staging.mlabs.city?remote-program=/run/current-system/sw/bin/nix-store";
system = "x86_64-darwin"; system = "x86_64-darwin";
maxJobs = 4; maxJobs = 4;
supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; supportedFeatures = [
"kvm"
"nixos-test"
"big-parallel"
"benchmark"
];
protocol = "ssh"; protocol = "ssh";
sshUser = "root"; sshUser = "root";
sshKey = "/home/${config.ccr.username}/.ssh/id_rsa"; sshKey = "/home/${config.ccr.username}/.ssh/id_rsa";

View file

@ -2,7 +2,8 @@ pkgs: epkgs:
let let
inherit (epkgs) melpaPackages nongnuPackages elpaPackages; inherit (epkgs) melpaPackages nongnuPackages elpaPackages;
buildEmacsPackage = args: buildEmacsPackage =
args:
epkgs.trivialBuild { epkgs.trivialBuild {
pname = args.name; pname = args.name;
inherit (args) src; inherit (args) src;
@ -26,10 +27,13 @@ let
}; };
# *List* containing emacs packages from (M)ELPA # *List* containing emacs packages from (M)ELPA
mainPackages = builtins.filter mainPackages =
builtins.filter
# if an extra package has the same name then give precedence to it # if an extra package has the same name then give precedence to it
(package: !builtins.elem package.pname (builtins.attrNames extraPackages)) (package: !builtins.elem package.pname (builtins.attrNames extraPackages))
(with melpaPackages; [ (
with melpaPackages;
[
meow meow
meow-tree-sitter meow-tree-sitter
dracula-theme dracula-theme
@ -104,6 +108,19 @@ let
solidity-mode solidity-mode
# org-re-reveal # FIXME very not nice hash mismatch when building # org-re-reveal # FIXME very not nice hash mismatch when building
# gptel # TODO uncomment when there will be a new release including GPT-4o # gptel # TODO uncomment when there will be a new release including GPT-4o
]) ++ (with elpaPackages; [ delight kind-icon ef-themes indent-bars ement ]) ]
++ (with nongnuPackages; [ eat corfu-terminal haskell-ts-mode ]); )
in mainPackages ++ (builtins.attrValues extraPackages) ++ (with elpaPackages; [
delight
kind-icon
ef-themes
indent-bars
ement
])
++ (with nongnuPackages; [
eat
corfu-terminal
haskell-ts-mode
]);
in
mainPackages ++ (builtins.attrValues extraPackages)