mirror of
https://github.com/hyprwm/hyprland-infra.git
synced 2025-05-12 21:30:36 +01:00
initial commit
This commit is contained in:
commit
0caff84048
5 changed files with 122 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
64
flake.lock
Normal file
64
flake.lock
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706830856,
|
||||
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1706732774,
|
||||
"narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1706550542,
|
||||
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
27
flake.nix
Normal file
27
flake.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
description = "Hyprland Infrastructure";
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
flake-parts,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
|
||||
perSystem = {pkgs, ...}: {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [pkgs.alejandra];
|
||||
};
|
||||
};
|
||||
|
||||
flake = {
|
||||
nixosConfigurations = import ./hosts {inherit self;};
|
||||
};
|
||||
};
|
||||
}
|
1
hosts/caesar/default.nix
Normal file
1
hosts/caesar/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
29
hosts/default.nix
Normal file
29
hosts/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{self, ...}: let
|
||||
inherit (self) inputs;
|
||||
|
||||
# TODO: move to standalone lib directory
|
||||
mkSystem = inputs.nixpkgs.lib.nixosSystem;
|
||||
|
||||
# mkNixosSystem wraps mkSystem (a.k.a lib.nixosSystem) with flake-parts' withSystem to provide inputs' and self' from flake-parts
|
||||
# it also acts as a template for my nixos hosts with system type and modules being imported beforehand
|
||||
# specialArgs is also defined here to avoid defining them for each host and lazily merged if the host defines any other args
|
||||
mkNixosSystem = {
|
||||
modules,
|
||||
system,
|
||||
hostname,
|
||||
...
|
||||
} @ args:
|
||||
mkSystem {
|
||||
inherit system;
|
||||
modules = {networking.hostName = hostname;} // args.modules or {};
|
||||
specialArgs = {inherit inputs self;} // args.specialArgs or {};
|
||||
};
|
||||
in {
|
||||
"caesar" = mkNixosSystem {
|
||||
hostname = "caesar";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./caesar
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue