Upgrade nix channel and formatter

This commit is contained in:
Arnie 2024-10-03 08:47:33 +02:00
parent 36e60604e6
commit 638c9719a4
3 changed files with 46 additions and 31 deletions

View File

@ -1,4 +1,6 @@
{ system ? builtins.currentSystem }: {
system ? builtins.currentSystem,
}:
let let
flake-compat = builtins.fetchTarball { flake-compat = builtins.fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/0f9255e01c2351cc7d116c072cb317785dd33b33.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/0f9255e01c2351cc7d116c072cb317785dd33b33.tar.gz";

View File

@ -22,16 +22,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1727348695, "lastModified": 1727872001,
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", "narHash": "sha256-nZNSePIWw526864XBqsrWU1dbo4Ei8iJXpNHCubui28=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", "rev": "e46dc3b8343f627532ba881965b053d3bbec4235",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,53 +2,66 @@
description = "Arnie's nix flake"; description = "Arnie's nix flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
devshell = { devshell = {
url = "github:numtide/devshell"; url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, devshell }: outputs =
{
self,
nixpkgs,
devshell,
}:
let let
systems = nixpkgs.lib.genAttrs [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; systems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
in in
{ {
lib = { lib = {
forAllSystems = function: systems (system: forAllSystems =
function (import nixpkgs { function:
inherit system; systems (
overlays = [ system:
devshell.overlays.default function (
]; import nixpkgs {
config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]); inherit system;
}) overlays = [ devshell.overlays.default ];
); config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]);
}
)
);
golangci-config-file = ./.golangci.yml; golangci-config-file = ./.golangci.yml;
cd_root = "cd $PRJ_ROOT;"; cd_root = "cd $PRJ_ROOT;";
control4_env = self.lib.forAllSystems (pkgs: pkgs.buildEnv { control4_env = self.lib.forAllSystems (
name = "control4_env"; pkgs:
paths = [ pkgs.buildEnv {
pkgs.lua5_1 name = "control4_env";
pkgs.lua51Packages.busted paths = [
pkgs.nodejs_22 pkgs.lua5_1
]; pkgs.lua51Packages.busted
}); pkgs.nodejs_22
];
}
);
}; };
formatter = self.lib.forAllSystems (pkgs: pkgs.nixpkgs-fmt); formatter = self.lib.forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
devShells = self.lib.forAllSystems (pkgs: { devShells = self.lib.forAllSystems (pkgs: {
default = pkgs.devshell.mkShell { default = pkgs.devshell.mkShell {
name = "nix"; name = "c3c-nix";
packages = [ packages = [ pkgs.nix-tree ];
pkgs.nix-tree
pkgs.golangci-lint
];
commands = [ commands = [
{ {