From cbf96db00463392b43bc26b2db88791512f099e2 Mon Sep 17 00:00:00 2001 From: Armel van Ravels Date: Fri, 19 Jun 2026 09:02:31 +0200 Subject: [PATCH] Add devenv nix --- .gitignore | 10 ++ devenv.lock | 146 +++++++++++++++++++++ devenv.nix | 19 +++ devenv.yaml | 11 ++ outputs.nix | 11 +- systems/balrog/default.nix | 9 +- systems/balrog/hardware-configuration.nix | 11 +- systems/frodo/hardware-configuration.nix | 11 +- systems/gandalf/hardware-configuration.nix | 11 +- systems/gandalf/mtp-fix.nix | 38 +++--- systems/legolas/hardware-configuration.nix | 11 +- systems/modules/home/programs/git.nix | 9 +- systems/modules/home/wm/hyprland.nix | 9 +- systems/work/hardware-configuration.nix | 11 +- 14 files changed, 247 insertions(+), 70 deletions(-) create mode 100644 .gitignore create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae49879 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Devenv +.devenv* +devenv.local.nix +devenv.local.yaml + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..0521afb --- /dev/null +++ b/devenv.lock @@ -0,0 +1,146 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1781800860, + "narHash": "sha256-LrEo0eC5ckMvjpBRCuk5q5/vjItKlxnb4n/clHNRZlk=", + "owner": "cachix", + "repo": "devenv", + "rev": "d59d872d80876d9eeb3e214d3b088bc4a14a9c4f", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781733627, + "narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "inputs": { + "nixpkgs-src": "nixpkgs-src" + }, + "locked": { + "lastModified": 1781620901, + "narHash": "sha256-UF6scQlG+6lRkZBUpn/3KNavhOo5G8kDWhjVHcno8uc=", + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "2df109b343d3c68efd752e32a444a1d9b9f89afa", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-src": { + "flake": false, + "locked": { + "lastModified": 1781454065, + "narHash": "sha256-d2xfDjnfRuf/xYGdu9VVRHiav/2w5hDL/5cw2TuVAXw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9eac87a12312b8f60dd52e1c6e1a265f6fc7f5fc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1780220602, + "narHash": "sha256-eynAfOmbmxJnkp7YewvCEbShNnnYJ9gLLqkzsYtBPeM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "db947814a175b7ca6ded66e21383d938df01c227", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..1f9b8ec --- /dev/null +++ b/devenv.nix @@ -0,0 +1,19 @@ +{ pkgs +, lib +, config +, ... +}: + +{ + treefmt.enable = true; + + treefmt.config.programs.nixpkgs-fmt.enable = true; + + git-hooks = { + enable = true; + + hooks = { + treefmt.enable = true; + }; + }; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..ce95b2d --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,11 @@ +inputs: + git-hooks: + url: github:cachix/git-hooks.nix + inputs: + nixpkgs: + follows: nixpkgs + treefmt-nix: + url: github:numtide/treefmt-nix + inputs: + nixpkgs: + follows: nixpkgs diff --git a/outputs.nix b/outputs.nix index 903ade5..8c382c1 100644 --- a/outputs.nix +++ b/outputs.nix @@ -1,9 +1,8 @@ -{ - nixpkgs, - nixpkgs-unstable, - home-manager, - nix-flatpak, - ... +{ nixpkgs +, nixpkgs-unstable +, home-manager +, nix-flatpak +, ... }: let diff --git a/systems/balrog/default.nix b/systems/balrog/default.nix index 1ab0772..df4753f 100644 --- a/systems/balrog/default.nix +++ b/systems/balrog/default.nix @@ -2,11 +2,10 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ - config, - lib, - pkgs, - ... +{ config +, lib +, pkgs +, ... }: { diff --git a/systems/balrog/hardware-configuration.nix b/systems/balrog/hardware-configuration.nix index 027a8e5..e37a8ea 100644 --- a/systems/balrog/hardware-configuration.nix +++ b/systems/balrog/hardware-configuration.nix @@ -1,12 +1,11 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: { diff --git a/systems/frodo/hardware-configuration.nix b/systems/frodo/hardware-configuration.nix index 7d7ada1..4a67f6a 100644 --- a/systems/frodo/hardware-configuration.nix +++ b/systems/frodo/hardware-configuration.nix @@ -1,12 +1,11 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: { diff --git a/systems/gandalf/hardware-configuration.nix b/systems/gandalf/hardware-configuration.nix index 3623f53..464594b 100644 --- a/systems/gandalf/hardware-configuration.nix +++ b/systems/gandalf/hardware-configuration.nix @@ -1,12 +1,11 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: { diff --git a/systems/gandalf/mtp-fix.nix b/systems/gandalf/mtp-fix.nix index 54b8099..65193e2 100644 --- a/systems/gandalf/mtp-fix.nix +++ b/systems/gandalf/mtp-fix.nix @@ -4,27 +4,27 @@ nixpkgs.overlays = [ ( final: prev: - let - targetVersion = "1.1.23"; - in - { - libmtp = - if builtins.compareVersions prev.libmtp.version targetVersion >= 0 then - prev.libmtp - else - prev.libmtp.overrideAttrs (_: { - version = targetVersion; + let + targetVersion = "1.1.23"; + in + { + libmtp = + if builtins.compareVersions prev.libmtp.version targetVersion >= 0 then + prev.libmtp + else + prev.libmtp.overrideAttrs (_: { + version = targetVersion; - src = final.fetchFromGitHub { - owner = "libmtp"; - repo = "libmtp"; - rev = "v${targetVersion}"; - hash = "sha256-FlPj9PEeOAWabU11dFTzDgY9TBbgmJclbeL0iULYw6A="; - }; + src = final.fetchFromGitHub { + owner = "libmtp"; + repo = "libmtp"; + rev = "v${targetVersion}"; + hash = "sha256-FlPj9PEeOAWabU11dFTzDgY9TBbgmJclbeL0iULYw6A="; + }; - patches = [ ]; - }); - } + patches = [ ]; + }); + } ) ]; } diff --git a/systems/legolas/hardware-configuration.nix b/systems/legolas/hardware-configuration.nix index cbebc78..a2d7688 100644 --- a/systems/legolas/hardware-configuration.nix +++ b/systems/legolas/hardware-configuration.nix @@ -1,12 +1,11 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: { diff --git a/systems/modules/home/programs/git.nix b/systems/modules/home/programs/git.nix index e4839d2..ecec1df 100644 --- a/systems/modules/home/programs/git.nix +++ b/systems/modules/home/programs/git.nix @@ -1,8 +1,7 @@ -{ - lib, - pkgsUnstable, - config, - ... +{ lib +, pkgsUnstable +, config +, ... }: { diff --git a/systems/modules/home/wm/hyprland.nix b/systems/modules/home/wm/hyprland.nix index 023c0ae..e52ca53 100644 --- a/systems/modules/home/wm/hyprland.nix +++ b/systems/modules/home/wm/hyprland.nix @@ -1,8 +1,7 @@ -{ - lib, - pkgs, - config, - ... +{ lib +, pkgs +, config +, ... }: let diff --git a/systems/work/hardware-configuration.nix b/systems/work/hardware-configuration.nix index a0d4d45..9a61672 100644 --- a/systems/work/hardware-configuration.nix +++ b/systems/work/hardware-configuration.nix @@ -1,12 +1,11 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: {