From 638c9719a4facaa36780c534ae97420658a90d42 Mon Sep 17 00:00:00 2001 From: Arnie Date: Thu, 3 Oct 2024 08:47:33 +0200 Subject: [PATCH] Upgrade nix channel and formatter --- default.nix | 4 +++- flake.lock | 8 +++---- flake.nix | 65 ++++++++++++++++++++++++++++++++--------------------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/default.nix b/default.nix index 87a8412..985bd5e 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,6 @@ -{ system ? builtins.currentSystem }: +{ + system ? builtins.currentSystem, +}: let flake-compat = builtins.fetchTarball { url = "https://github.com/edolstra/flake-compat/archive/0f9255e01c2351cc7d116c072cb317785dd33b33.tar.gz"; diff --git a/flake.lock b/flake.lock index 48ea267..7b5f83f 100644 --- a/flake.lock +++ b/flake.lock @@ -22,16 +22,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "lastModified": 1727872001, + "narHash": "sha256-nZNSePIWw526864XBqsrWU1dbo4Ei8iJXpNHCubui28=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "rev": "e46dc3b8343f627532ba881965b053d3bbec4235", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index df42125..ccf61db 100644 --- a/flake.nix +++ b/flake.nix @@ -2,53 +2,66 @@ description = "Arnie's nix flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; devshell = { url = "github:numtide/devshell"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, devshell }: + outputs = + { + self, + nixpkgs, + devshell, + }: 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 { lib = { - forAllSystems = function: systems (system: - function (import nixpkgs { - inherit system; - overlays = [ - devshell.overlays.default - ]; - config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]); - }) - ); + forAllSystems = + function: + systems ( + system: + function ( + import nixpkgs { + inherit system; + overlays = [ devshell.overlays.default ]; + config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]); + } + ) + ); golangci-config-file = ./.golangci.yml; cd_root = "cd $PRJ_ROOT;"; - control4_env = self.lib.forAllSystems (pkgs: pkgs.buildEnv { - name = "control4_env"; - paths = [ - pkgs.lua5_1 - pkgs.lua51Packages.busted - pkgs.nodejs_22 - ]; - }); + control4_env = self.lib.forAllSystems ( + pkgs: + pkgs.buildEnv { + name = "control4_env"; + paths = [ + 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: { default = pkgs.devshell.mkShell { - name = "nix"; + name = "c3c-nix"; - packages = [ - pkgs.nix-tree - pkgs.golangci-lint - ]; + packages = [ pkgs.nix-tree ]; commands = [ {