Switch to flake-parts modules for treefmt and devshell
This commit is contained in:
parent
0a37261ba5
commit
138a204f13
6 changed files with 112 additions and 81 deletions
|
@ -11,4 +11,3 @@ creation_rules:
|
|||
- *vpn
|
||||
- *vpn_ssh
|
||||
- *builder
|
||||
|
||||
|
|
8
Justfile
8
Justfile
|
@ -1,8 +0,0 @@
|
|||
default:
|
||||
home-manager switch --flake .#sudoer777
|
||||
update:
|
||||
nix flake update
|
||||
backup:
|
||||
home-manager switch --flake .#sudoer777 -b backup
|
||||
man:
|
||||
man home-configuration.nix
|
|
@ -1,6 +1,6 @@
|
|||
# Laptop configuration
|
||||
|
||||
This is the Nix home-manager configuration for my laptop, allowing me to easily manage a user configuration that can quickly be reproduced on other machines. It is currently being used on a foreign distro (Fedora Asahi Remix), but I plan to switch to NixOS when time allows and make it reusable for other systems I am currently using.
|
||||
This is the Nix home-manager configuration for my laptop, allowing me to easily manage a user configuration that can quickly be reproduced on other machines. It is currently being used on a foreign distro (Fedora Asahi Remix), but I plan to switch to NixOS when time allows and make it reusable for other systems I am currently using. It uses direnv to automatically load the environment for running commands for this Flake.
|
||||
|
||||
## Features
|
||||
|
||||
|
|
50
flake.lock
generated
50
flake.lock
generated
|
@ -1,5 +1,23 @@
|
|||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741473158,
|
||||
"narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
|
@ -127,9 +145,7 @@
|
|||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"flakey-profile": "flakey-profile",
|
||||
"lix": [
|
||||
"lix"
|
||||
],
|
||||
"lix": "lix",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -168,6 +184,22 @@
|
|||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1722073938,
|
||||
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1749776303,
|
||||
"narHash": "sha256-OHibOvVwKqO1qvRg0r3agtd1EagW4THBcoWT7QGgcNo=",
|
||||
|
@ -183,7 +215,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1749285348,
|
||||
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
|
||||
|
@ -199,7 +231,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1747958103,
|
||||
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
|
||||
|
@ -218,7 +250,7 @@
|
|||
"nur": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -237,12 +269,12 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager",
|
||||
"lix": "lix",
|
||||
"lix-module": "lix-module",
|
||||
"nixgl": "nixgl",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nur": "nur",
|
||||
"sops-nix": "sops-nix",
|
||||
"treefmt-nix": "treefmt-nix_2"
|
||||
|
@ -306,7 +338,7 @@
|
|||
},
|
||||
"treefmt-nix_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1750931469,
|
||||
|
|
60
flake.nix
60
flake.nix
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
description = "Home Manager configuration";
|
||||
inputs = {
|
||||
devshell.url = "github:numtide/devshell";
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
|
@ -10,14 +11,9 @@
|
|||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
lix = {
|
||||
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
lix-module = {
|
||||
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.lix.follows = "lix";
|
||||
};
|
||||
nixgl = {
|
||||
url = "github:nix-community/nixGL";
|
||||
|
@ -40,20 +36,17 @@
|
|||
systems = [ "aarch64-linux" ];
|
||||
imports = [
|
||||
inputs.home-manager.flakeModules.home-manager
|
||||
inputs.treefmt-nix.flakeModule
|
||||
inputs.devshell.flakeModule
|
||||
# ./home/flake-module.nix
|
||||
];
|
||||
flake = {
|
||||
homeConfigurations = {
|
||||
asahi = withSystem "aarch64-linux" (
|
||||
ctx@{
|
||||
config,
|
||||
inputs',
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = { inherit inputs inputs' pkgs; };
|
||||
extraSpecialArgs = { inherit inputs pkgs; };
|
||||
modules = [
|
||||
./home/home.nix
|
||||
inputs.lix-module.nixosModules.default
|
||||
|
@ -65,7 +58,7 @@
|
|||
};
|
||||
};
|
||||
perSystem =
|
||||
{ self', system, ... }:
|
||||
{ system, config, ... }:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
|
@ -74,32 +67,47 @@
|
|||
inputs.nixgl.overlays.default
|
||||
];
|
||||
};
|
||||
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
||||
treefmtWrapper = treefmtEval.config.build.wrapper;
|
||||
in
|
||||
{
|
||||
_module.args.pkgs = pkgs;
|
||||
_module.args.treefmtEval = treefmtEval;
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
inputs.lix.outPath
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
devshells.default = {
|
||||
commands = [
|
||||
{
|
||||
help = "`home-manager switch` for asahi";
|
||||
name = "switch-asahi";
|
||||
command = "home-manager switch --flake .#asahi";
|
||||
}
|
||||
{
|
||||
help = "`home-manager switch` for asahi with backup";
|
||||
name = "switch-asahi-backup";
|
||||
command = "home-manager switch --flake .#asahi -b backup";
|
||||
}
|
||||
{
|
||||
help = "update dependencies";
|
||||
name = "update";
|
||||
command = "nix flake update";
|
||||
}
|
||||
{
|
||||
help = "show home-manager documentation";
|
||||
name = "man-home";
|
||||
command = "man home-configuration.nix";
|
||||
}
|
||||
];
|
||||
packages = [
|
||||
config.treefmt.build.wrapper
|
||||
pkgs.age
|
||||
pkgs.forgejo-cli
|
||||
pkgs.helix
|
||||
pkgs.just
|
||||
pkgs.lix
|
||||
pkgs.marksman
|
||||
pkgs.nil
|
||||
pkgs.sops
|
||||
pkgs.taplo
|
||||
pkgs.uutils-coreutils
|
||||
pkgs.yaml-language-server
|
||||
treefmtWrapper
|
||||
];
|
||||
};
|
||||
# formatter.${system} = treefmtWrapper;
|
||||
# checks.${system} = {
|
||||
# formatting = treefmtEval.config.build.check self;
|
||||
# };
|
||||
treefmt = ./treefmt.nix;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue