add devshell and justfile

This commit is contained in:
uku 2023-11-14 00:56:27 +01:00
parent a87c9565a7
commit c31f5579d8
Signed by: uku
GPG key ID: 7D01D7B105E77166
5 changed files with 75 additions and 21 deletions

2
.envrc Normal file
View file

@ -0,0 +1,2 @@
use flake
watch_file flake.nix

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
# build artifacts
result
# dev shell
.pre-commit-config.yaml
.direnv/

View file

@ -131,8 +131,6 @@ in {
pavucontrol pavucontrol
obs-studio obs-studio
mpv mpv
vscode
nil
glfw-wayland-minecraft glfw-wayland-minecraft
(prismlauncher.override { (prismlauncher.override {
jdks = [temurin-bin-17]; jdks = [temurin-bin-17];
@ -146,7 +144,6 @@ in {
ragenix.packages.${system}.default ragenix.packages.${system}.default
getchvim.packages.${system}.default getchvim.packages.${system}.default
nix-your-shell nix-your-shell
neovide
]; ];
services = { services = {

View file

@ -37,12 +37,17 @@
}; };
outputs = { outputs = {
flake-parts,
nixpkgs, nixpkgs,
ragenix, ragenix,
lanzaboote, lanzaboote,
home-manager, home-manager,
... ...
} @ inputs: let } @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
flake = let
mkSystem = name: mkSystem = name:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -62,7 +67,23 @@
}; };
in { in {
nixosConfigurations = nixpkgs.lib.genAttrs ["fuji" "kilimandjaro"] mkSystem; nixosConfigurations = nixpkgs.lib.genAttrs ["fuji" "kilimandjaro"] mkSystem;
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; perSystem = {system, ...}: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
alejandra
fzf
just
nil
];
};
formatter = pkgs.alejandra;
};
}; };
} }

28
justfile Normal file
View file

@ -0,0 +1,28 @@
# Shamelessly taken from https://github.com/getchoo/flake/blob/d80d49cc7652ea84810c4688212c48277dfc71be/justfile
alias b := build
alias c := check
alias s := switch
alias t := test
default:
@just --choose
[linux]
build *args:
nixos-rebuild build --flake . {{ args }}
nix run n#nvd -- diff /run/current-system/ result/
check:
nix flake check
[linux]
switch *args:
sudo nixos-rebuild switch --flake . --keep-going {{ args }}
[linux]
test:
sudo nixos-rebuild test --flake .
update: (switch "--recreate-lock-file")
nix-index