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 = { ... }: {
treefmt.config = {
projectRootFile = ".git/config";
programs = {
nixfmt.enable = true;
perSystem =
{ ... }:
{
treefmt.config = {
projectRootFile = ".git/config";
programs = {
nixfmt.enable = true;
deadnix.enable = false;
};
};
pre-commit.settings.hooks = {
nixfmt-rfc-style.enable = true;
deadnix.enable = false;
};
};
pre-commit.settings.hooks = {
nixfmt-rfc-style.enable = true;
deadnix.enable = false;
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;
};
};
};
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 =
"A complete, declarative, and reproducible configuration of my entire Nix fleet";
description = "A complete, declarative, and reproducible configuration of my entire Nix fleet";
inputs = {
flakeParts.url = "github:hercules-ci/flake-parts";
@ -34,11 +33,12 @@
url = "github:MatthewCroughan/NixThePlanet/";
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";
lix = {
url =
"git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update
url = "git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update
flake = false;
};
lix-module = {
@ -65,7 +65,8 @@
emacs-overlay.url = "github:nix-community/emacs-overlay";
};
outputs = inputs@{ flakeParts, ... }:
outputs =
inputs@{ flakeParts, ... }:
flakeParts.lib.mkFlake { inherit inputs; } {
imports = [
# TODO export modules as flake outputs
@ -76,6 +77,9 @@
./shell
./checks
];
systems = [ "x86_64-linux" "aarch64-linux" ];
systems = [
"x86_64-linux"
"aarch64-linux"
];
};
}

View file

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

View file

@ -1,34 +1,42 @@
{ fleetModules, lib, pkgs, ... }: {
imports = fleetModules [
"common"
"ssh"
"ccr"
"nix"
"networkmanager"
"bluetooth"
"dbus"
"docker"
"fonts"
"qmk-udev"
"mosh"
"udisks2"
"xdg"
"pipewire"
"nix-development"
"virt-manager"
"ssh-initrd"
"printing"
"pam"
"wireguard-client"
"greetd"
"syncthing"
"mount-sisko"
"adb"
"binfmt"
"prometheus-exporters"
"promtail"
"syncthing"
] ++ [ ./disko.nix ];
{
fleetModules,
lib,
pkgs,
...
}:
{
imports =
fleetModules [
"common"
"ssh"
"ccr"
"nix"
"networkmanager"
"bluetooth"
"dbus"
"docker"
"fonts"
"qmk-udev"
"mosh"
"udisks2"
"xdg"
"pipewire"
"nix-development"
"virt-manager"
"ssh-initrd"
"printing"
"pam"
"wireguard-client"
"greetd"
"syncthing"
"mount-sisko"
"adb"
"binfmt"
"prometheus-exporters"
"promtail"
"syncthing"
]
++ [ ./disko.nix ];
ccr = {
enable = true;
@ -70,8 +78,12 @@
};
boot.initrd.kernelModules = [ "i915" ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usb_storage"
"sd_mod"
];
boot.kernelModules = [ "kvm-intel" ];
boot.kernelPackages = pkgs.linuxPackages;

View file

@ -1,40 +1,49 @@
{ fleetModules, lib, config, pkgs, ... }: {
imports = fleetModules [
"common"
"ssh"
"ccr"
"nix"
"networkmanager"
"bluetooth"
"dbus"
"docker"
"fonts"
"qmk-udev"
"mosh"
"udisks2"
"xdg"
"pipewire"
"nix-development"
"waydroid"
"virt-manager"
"ssh-initrd"
"printing"
"pam"
"wireguard-client"
"binfmt"
"greetd"
"syncthing"
"hass-poweroff"
"forgejo-runners"
"teamviewer"
"macos-ventura"
"sunshine"
"mount-sisko"
"adb"
"guix"
"prometheus-exporters"
"promtail"
] ++ [ ./disko.nix ];
{
fleetModules,
lib,
config,
pkgs,
...
}:
{
imports =
fleetModules [
"common"
"ssh"
"ccr"
"nix"
"networkmanager"
"bluetooth"
"dbus"
"docker"
"fonts"
"qmk-udev"
"mosh"
"udisks2"
"xdg"
"pipewire"
"nix-development"
"waydroid"
"virt-manager"
"ssh-initrd"
"printing"
"pam"
"wireguard-client"
"binfmt"
"greetd"
"syncthing"
"hass-poweroff"
"forgejo-runners"
"teamviewer"
"macos-ventura"
"sunshine"
"mount-sisko"
"adb"
"guix"
"prometheus-exporters"
"promtail"
]
++ [ ./disko.nix ];
ccr = {
enable = true;
@ -88,8 +97,13 @@
boot.kernelParams = [ "ip=dhcp" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "r8169" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"r8169"
];
boot.kernelModules = [
"kvm-amd"
"ddcci"
@ -138,8 +152,7 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.enableRedistributableFirmware = lib.mkDefault true;
hardware.graphics = {

View file

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

View file

@ -2,7 +2,8 @@ pkgs: epkgs:
let
inherit (epkgs) melpaPackages nongnuPackages elpaPackages;
buildEmacsPackage = args:
buildEmacsPackage =
args:
epkgs.trivialBuild {
pname = args.name;
inherit (args) src;
@ -26,84 +27,100 @@ let
};
# *List* containing emacs packages from (M)ELPA
mainPackages = builtins.filter
# if an extra package has the same name then give precedence to it
(package: !builtins.elem package.pname (builtins.attrNames extraPackages))
(with melpaPackages; [
meow
meow-tree-sitter
dracula-theme
nord-theme
catppuccin-theme
modus-themes
# solaire-mode
nerd-icons
nerd-icons-completion
nerd-icons-ibuffer
nerd-icons-dired
ligature
treemacs-nerd-icons
eshell-syntax-highlighting
fish-completion # fish completion for eshell
eshell-prompt-extras
eshell-atuin
eshell-command-not-found
clipetty
sideline
consult-eglot
# sideline-flymake
rainbow-delimiters
vertico
marginalia
consult
orderless
embark
embark-consult
magit
magit-delta
magit-todos
difftastic
with-editor
diff-hl
corfu
cape
which-key
nix-mode
nix-ts-mode
agenix
zig-mode
unisonlang-mode
purescript-mode
dhall-mode
envrc
inheritenv
popper
paredit
yaml-mode
hl-todo
markdown-mode
haskell-mode
terraform-mode
diredfl
org-modern
org-roam
org-roam-ql
org-roam-ui
visual-fill-column
consult-org-roam
pass
password-store-otp
eldoc-box
go-translate
notmuch
consult-notmuch
poly-org
casual
gptel
agenix
solidity-mode
# org-re-reveal # FIXME very not nice hash mismatch when building
# 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)
mainPackages =
builtins.filter
# if an extra package has the same name then give precedence to it
(package: !builtins.elem package.pname (builtins.attrNames extraPackages))
(
with melpaPackages;
[
meow
meow-tree-sitter
dracula-theme
nord-theme
catppuccin-theme
modus-themes
# solaire-mode
nerd-icons
nerd-icons-completion
nerd-icons-ibuffer
nerd-icons-dired
ligature
treemacs-nerd-icons
eshell-syntax-highlighting
fish-completion # fish completion for eshell
eshell-prompt-extras
eshell-atuin
eshell-command-not-found
clipetty
sideline
consult-eglot
# sideline-flymake
rainbow-delimiters
vertico
marginalia
consult
orderless
embark
embark-consult
magit
magit-delta
magit-todos
difftastic
with-editor
diff-hl
corfu
cape
which-key
nix-mode
nix-ts-mode
agenix
zig-mode
unisonlang-mode
purescript-mode
dhall-mode
envrc
inheritenv
popper
paredit
yaml-mode
hl-todo
markdown-mode
haskell-mode
terraform-mode
diredfl
org-modern
org-roam
org-roam-ql
org-roam-ui
visual-fill-column
consult-org-roam
pass
password-store-otp
eldoc-box
go-translate
notmuch
consult-notmuch
poly-org
casual
gptel
agenix
solidity-mode
# org-re-reveal # FIXME very not nice hash mismatch when building
# 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)