enforce new flake schema. formatting.
This commit is contained in:
parent
4b0a90e00d
commit
ecf5132cbb
121 changed files with 1606 additions and 1554 deletions
5
templates/nix-configs/server/.gitignore
vendored
Normal file
5
templates/nix-configs/server/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.direnv/
|
||||
.envrc
|
||||
.pre-commit-config.yaml
|
||||
result
|
||||
target
|
||||
|
|
@ -5,10 +5,7 @@
|
|||
nixpkgs-old-stable.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
|
||||
synix.url = "git+https://git.sid.ovh/sid/synix.git?ref=release-25.11";
|
||||
synix.imputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
synix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
@ -20,14 +17,22 @@
|
|||
let
|
||||
inherit (self) outputs;
|
||||
|
||||
supportedSystems = [
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
lib = nixpkgs.lib.extend (_final: _prev: inputs.synix.lib or { });
|
||||
|
||||
lib = nixpkgs.lib.extend (final: prev: inputs.synix.lib or { });
|
||||
inherit (lib.helpers) mkPkgs;
|
||||
|
||||
forAllSystems =
|
||||
function:
|
||||
lib.genAttrs systems (
|
||||
system:
|
||||
function (mkPkgs {
|
||||
inherit system;
|
||||
})
|
||||
);
|
||||
|
||||
mkNixosConfiguration =
|
||||
system: modules:
|
||||
|
|
@ -39,51 +44,37 @@
|
|||
};
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
packages = forAllSystems (pkgs: import ./pkgs { inherit pkgs; });
|
||||
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
|
||||
nixosModules = import ./modules/nixos;
|
||||
homeModules = import ./modules/home;
|
||||
|
||||
devShells = forAllSystems (
|
||||
pkgs:
|
||||
let
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
in
|
||||
{
|
||||
default = inputs.synix.devShells.${system}.nix-config;
|
||||
}
|
||||
);
|
||||
|
||||
nixosConfigurations = {
|
||||
HOSTNAME = mkNixosConfiguration "x86_64-linux" [ ./hosts/HOSTNAME ];
|
||||
};
|
||||
|
||||
formatter = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
config = self.checks.${system}.pre-commit-check.config;
|
||||
inherit (config) package configFile;
|
||||
script = ''
|
||||
${pkgs.lib.getExe package} run --all-files --config ${configFile}
|
||||
'';
|
||||
in
|
||||
pkgs.writeShellScriptBin "pre-commit-run" script
|
||||
);
|
||||
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
pkgs:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
flakePkgs = self.packages.${system};
|
||||
overlaidPkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.modifications ];
|
||||
};
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
in
|
||||
{
|
||||
pre-commit-check = inputs.git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixfmt.enable = true;
|
||||
};
|
||||
};
|
||||
build-packages = pkgs.linkFarm "flake-packages-${system}" flakePkgs;
|
||||
build-overlays = pkgs.linkFarm "flake-overlays-${system}" {
|
||||
# package = overlaidPkgs.package;
|
||||
};
|
||||
inherit (inputs.synix.checks.${system}) pre-commit-check build-additions build-modifications;
|
||||
}
|
||||
);
|
||||
|
||||
inherit (inputs.synix) formatter;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,20 +11,22 @@
|
|||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"nvme"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
"sr_mod"
|
||||
"usb_storage"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"xhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"nvme"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
"sr_mod"
|
||||
"usb_storage"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"xhci_pci"
|
||||
];
|
||||
initrd.kernelModules = [ ];
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/ROOT";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue