add devshell and justfile
This commit is contained in:
parent
a87c9565a7
commit
c31f5579d8
5 changed files with 75 additions and 21 deletions
2
.envrc
Normal file
2
.envrc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
use flake
|
||||||
|
watch_file flake.nix
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# build artifacts
|
||||||
|
result
|
||||||
|
|
||||||
|
# dev shell
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
.direnv/
|
|
@ -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 = {
|
||||||
|
|
57
flake.nix
57
flake.nix
|
@ -37,32 +37,53 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
flake-parts,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
ragenix,
|
ragenix,
|
||||||
lanzaboote,
|
lanzaboote,
|
||||||
home-manager,
|
home-manager,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs:
|
||||||
mkSystem = name:
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
nixpkgs.lib.nixosSystem {
|
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
./common.nix
|
|
||||||
|
|
||||||
./${name}
|
flake = let
|
||||||
./${name}/hardware-configuration.nix
|
mkSystem = name:
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./common.nix
|
||||||
|
|
||||||
{networking.hostName = name;}
|
./${name}
|
||||||
|
./${name}/hardware-configuration.nix
|
||||||
|
|
||||||
ragenix.nixosModules.default
|
{networking.hostName = name;}
|
||||||
lanzaboote.nixosModules.lanzaboote
|
|
||||||
home-manager.nixosModules.home-manager
|
ragenix.nixosModules.default
|
||||||
];
|
lanzaboote.nixosModules.lanzaboote
|
||||||
specialArgs = inputs;
|
home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
specialArgs = inputs;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
nixosConfigurations = nixpkgs.lib.genAttrs ["fuji" "kilimandjaro"] mkSystem;
|
||||||
};
|
};
|
||||||
in {
|
|
||||||
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
28
justfile
Normal 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
|
Loading…
Reference in a new issue