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,27 +1,40 @@
{ 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 = { { ... }:
projectRootFile = ".git/config"; {
programs = { treefmt.config = {
nixfmt.enable = true; projectRootFile = ".git/config";
programs = {
nixfmt.enable = true;
deadnix.enable = false;
};
};
pre-commit.settings.hooks = {
nixfmt-rfc-style.enable = true;
deadnix.enable = false; deadnix.enable = false;
}; };
}; };
pre-commit.settings.hooks = { flake.checks =
nixfmt-rfc-style.enable = true; let
deadnix.enable = false; build = _: nc: nc.config.system.build.toplevel;
in
{
x86_64-linux = lib.mapAttrs build { inherit (self.nixosConfigurations) picard; };
aarch64-linux = lib.mapAttrs build {
inherit (self.nixosConfigurations) sisko; # pbp;
};
}; };
};
flake.checks = let build = _: nc: nc.config.system.build.toplevel;
in {
x86_64-linux =
lib.mapAttrs build { inherit (self.nixosConfigurations) picard; };
aarch64-linux = lib.mapAttrs build {
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,34 +1,42 @@
{ fleetModules, lib, pkgs, ... }: { {
imports = fleetModules [ fleetModules,
"common" lib,
"ssh" pkgs,
"ccr" ...
"nix" }:
"networkmanager" {
"bluetooth" imports =
"dbus" fleetModules [
"docker" "common"
"fonts" "ssh"
"qmk-udev" "ccr"
"mosh" "nix"
"udisks2" "networkmanager"
"xdg" "bluetooth"
"pipewire" "dbus"
"nix-development" "docker"
"virt-manager" "fonts"
"ssh-initrd" "qmk-udev"
"printing" "mosh"
"pam" "udisks2"
"wireguard-client" "xdg"
"greetd" "pipewire"
"syncthing" "nix-development"
"mount-sisko" "virt-manager"
"adb" "ssh-initrd"
"binfmt" "printing"
"prometheus-exporters" "pam"
"promtail" "wireguard-client"
"syncthing" "greetd"
] ++ [ ./disko.nix ]; "syncthing"
"mount-sisko"
"adb"
"binfmt"
"prometheus-exporters"
"promtail"
"syncthing"
]
++ [ ./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,40 +1,49 @@
{ fleetModules, lib, config, pkgs, ... }: { {
imports = fleetModules [ fleetModules,
"common" lib,
"ssh" config,
"ccr" pkgs,
"nix" ...
"networkmanager" }:
"bluetooth" {
"dbus" imports =
"docker" fleetModules [
"fonts" "common"
"qmk-udev" "ssh"
"mosh" "ccr"
"udisks2" "nix"
"xdg" "networkmanager"
"pipewire" "bluetooth"
"nix-development" "dbus"
"waydroid" "docker"
"virt-manager" "fonts"
"ssh-initrd" "qmk-udev"
"printing" "mosh"
"pam" "udisks2"
"wireguard-client" "xdg"
"binfmt" "pipewire"
"greetd" "nix-development"
"syncthing" "waydroid"
"hass-poweroff" "virt-manager"
"forgejo-runners" "ssh-initrd"
"teamviewer" "printing"
"macos-ventura" "pam"
"sunshine" "wireguard-client"
"mount-sisko" "binfmt"
"adb" "greetd"
"guix" "syncthing"
"prometheus-exporters" "hass-poweroff"
"promtail" "forgejo-runners"
] ++ [ ./disko.nix ]; "teamviewer"
"macos-ventura"
"sunshine"
"mount-sisko"
"adb"
"guix"
"prometheus-exporters"
"promtail"
]
++ [ ./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,11 +1,15 @@
{ 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,29 +56,32 @@
options = "--delete-older-than 180d"; options = "--delete-older-than 180d";
}; };
registry = lib.mkForce ({ registry = lib.mkForce (
nixpkgs.to = { {
type = "path"; nixpkgs.to = {
path = fleetFlake.inputs.nixpkgs; type = "path";
}; path = fleetFlake.inputs.nixpkgs;
n.to = { };
type = "path"; n.to = {
path = fleetFlake.inputs.nixpkgs; type = "path";
}; path = fleetFlake.inputs.nixpkgs;
} // (lib.optionalAttrs (builtins.hasAttr "ccr" config) { };
nixfleet.to = { }
type = "path"; // (lib.optionalAttrs (builtins.hasAttr "ccr" config) {
path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; nixfleet.to = {
}; type = "path";
fleet.to = { path = "/home/${config.ccr.username}/projects/aciceri/nixfleet";
type = "path"; };
path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; fleet.to = {
}; type = "path";
ccrEmacs.to = { path = "/home/${config.ccr.username}/projects/aciceri/nixfleet";
type = "path"; };
path = "/home/${config.ccr.username}/.config/emacs"; ccrEmacs.to = {
}; type = "path";
})); 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,84 +27,100 @@ let
}; };
# *List* containing emacs packages from (M)ELPA # *List* containing emacs packages from (M)ELPA
mainPackages = builtins.filter mainPackages =
# if an extra package has the same name then give precedence to it builtins.filter
(package: !builtins.elem package.pname (builtins.attrNames extraPackages)) # if an extra package has the same name then give precedence to it
(with melpaPackages; [ (package: !builtins.elem package.pname (builtins.attrNames extraPackages))
meow (
meow-tree-sitter with melpaPackages;
dracula-theme [
nord-theme meow
catppuccin-theme meow-tree-sitter
modus-themes dracula-theme
# solaire-mode nord-theme
nerd-icons catppuccin-theme
nerd-icons-completion modus-themes
nerd-icons-ibuffer # solaire-mode
nerd-icons-dired nerd-icons
ligature nerd-icons-completion
treemacs-nerd-icons nerd-icons-ibuffer
eshell-syntax-highlighting nerd-icons-dired
fish-completion # fish completion for eshell ligature
eshell-prompt-extras treemacs-nerd-icons
eshell-atuin eshell-syntax-highlighting
eshell-command-not-found fish-completion # fish completion for eshell
clipetty eshell-prompt-extras
sideline eshell-atuin
consult-eglot eshell-command-not-found
# sideline-flymake clipetty
rainbow-delimiters sideline
vertico consult-eglot
marginalia # sideline-flymake
consult rainbow-delimiters
orderless vertico
embark marginalia
embark-consult consult
magit orderless
magit-delta embark
magit-todos embark-consult
difftastic magit
with-editor magit-delta
diff-hl magit-todos
corfu difftastic
cape with-editor
which-key diff-hl
nix-mode corfu
nix-ts-mode cape
agenix which-key
zig-mode nix-mode
unisonlang-mode nix-ts-mode
purescript-mode agenix
dhall-mode zig-mode
envrc unisonlang-mode
inheritenv purescript-mode
popper dhall-mode
paredit envrc
yaml-mode inheritenv
hl-todo popper
markdown-mode paredit
haskell-mode yaml-mode
terraform-mode hl-todo
diredfl markdown-mode
org-modern haskell-mode
org-roam terraform-mode
org-roam-ql diredfl
org-roam-ui org-modern
visual-fill-column org-roam
consult-org-roam org-roam-ql
pass org-roam-ui
password-store-otp visual-fill-column
eldoc-box consult-org-roam
go-translate pass
notmuch password-store-otp
consult-notmuch eldoc-box
poly-org go-translate
casual notmuch
gptel consult-notmuch
agenix poly-org
solidity-mode casual
# org-re-reveal # FIXME very not nice hash mismatch when building gptel
# gptel # TODO uncomment when there will be a new release including GPT-4o agenix
]) ++ (with elpaPackages; [ delight kind-icon ef-themes indent-bars ement ]) solidity-mode
++ (with nongnuPackages; [ eat corfu-terminal haskell-ts-mode ]); # org-re-reveal # FIXME very not nice hash mismatch when building
in mainPackages ++ (builtins.attrValues extraPackages) # 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)