feat(nix): add initial Nix flake configuration and lock file for package management

This commit is contained in:
2026-01-14 18:59:10 +00:00
parent a954f2b588
commit a6af299d8d
3 changed files with 67 additions and 0 deletions

4
default.nix Normal file
View File

@@ -0,0 +1,4 @@
let
flake = builtins.getFlake "git+file://${builtins.toString ./.}";
in
flake.packages.${builtins.currentSystem}.default

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1768302833,
"narHash": "sha256-h5bRFy9bco+8QcK7rGoOiqMxMbmn21moTACofNLRMP4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "61db79b0c6b838d9894923920b612048e1201926",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

36
flake.nix Normal file
View File

@@ -0,0 +1,36 @@
{
description = "Global packages for dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-darwin"
"aarch64-darwin"
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.buildEnv {
name = "dotfiles-packages";
paths = [
pkgs.nil
pkgs.nixfmt
];
};
}
);
};
}