Skip to content

Commit

Permalink
flake.nix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoth committed Apr 2, 2024
1 parent 883d7ec commit e544649
Showing 1 changed file with 59 additions and 50 deletions.
109 changes: 59 additions & 50 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,60 +44,69 @@
sops-nix,
pre-commit-hooks,
...
} @ inputs: let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
nixfmt.enable = false;
statix.enable = true;
};
};
};
in {
} @ inputs: {
nixosConfigurations = {
# Moth`s PC (Thinkpad P1 G5 Laptop currently)
pcLexell = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./machines/pcLexell
home-manager.nixosModules.home-manager
nur.nixosModules.nur
stylix.nixosModules.stylix
sops-nix.nixosModules.sops
#ags.homeManagerModules.default
{
nixpkgs.overlays = [nur.overlay];
_module.args.master = import inputs.master {inherit (pkgs.stdenv.targetPlatform) system;};
_module.args.stable = import inputs.stable {inherit (pkgs.stdenv.targetPlatform) system;};
}
];
specialArgs = {
inherit inputs;
hostname = "pcLexell";
pcLexell = let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
in
nixpkgs.lib.nixosSystem {
modules = [
./machines/pcLexell
home-manager.nixosModules.home-manager
nur.nixosModules.nur
stylix.nixosModules.stylix
sops-nix.nixosModules.sops
{
nixpkgs.overlays = [nur.overlay];
_module.args.master = import inputs.master {inherit (pkgs.stdenv.targetPlatform) system;};
_module.args.stable = import inputs.stable {inherit (pkgs.stdenv.targetPlatform) system;};
}
];
specialArgs = {
inherit inputs;
hostname = "pcLexell";
};
};
};
};
# idk why I use two devShells for x86 and aarh instead of one crossplatform
# I just copy-paste this template
devShells.x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux;
mkShell {
inherit (checks.pre-commit-check) shellHook;
buildInputs = [
alejandra
statix
];
};
devShells.aarch64-linux.default = with nixpkgs.legacyPackages.aarch64-linux;
mkShell {
inherit (checks.pre-commit-check) shellHook;
buildInputs = [
alejandra
statix
];
};
# I just copy-paste this template from somewhere
devShells = {
x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux;
mkShell {
inherit
(pre-commit-hooks.lib.x86_64-linux.run {
src = ./.;
hooks = {
alejandra.enable = true;
statix.enable = true;
};
})
shellHook
;
buildInputs = [
alejandra
statix
];
};
aarch64-linux.default = with nixpkgs.legacyPackages.aarch64-linux;
mkShell {
inherit
(pre-commit-hooks.lib.aarch64-linux.run {
src = ./.;
hooks = {
alejandra.enable = true;
statix.enable = true;
};
})
shellHook
;
buildInputs = [
alejandra
statix
];
};
};
};
}

0 comments on commit e544649

Please sign in to comment.