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
|
||||
obs-studio
|
||||
mpv
|
||||
vscode
|
||||
nil
|
||||
glfw-wayland-minecraft
|
||||
(prismlauncher.override {
|
||||
jdks = [temurin-bin-17];
|
||||
|
@ -146,7 +144,6 @@ in {
|
|||
ragenix.packages.${system}.default
|
||||
getchvim.packages.${system}.default
|
||||
nix-your-shell
|
||||
neovide
|
||||
];
|
||||
|
||||
services = {
|
||||
|
|
57
flake.nix
57
flake.nix
|
@ -37,32 +37,53 @@
|
|||
};
|
||||
|
||||
outputs = {
|
||||
flake-parts,
|
||||
nixpkgs,
|
||||
ragenix,
|
||||
lanzaboote,
|
||||
home-manager,
|
||||
...
|
||||
} @ inputs: let
|
||||
mkSystem = name:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./common.nix
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
|
||||
|
||||
./${name}
|
||||
./${name}/hardware-configuration.nix
|
||||
flake = let
|
||||
mkSystem = name:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./common.nix
|
||||
|
||||
{networking.hostName = name;}
|
||||
./${name}
|
||||
./${name}/hardware-configuration.nix
|
||||
|
||||
ragenix.nixosModules.default
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
home-manager.nixosModules.home-manager
|
||||
];
|
||||
specialArgs = inputs;
|
||||
{networking.hostName = name;}
|
||||
|
||||
ragenix.nixosModules.default
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
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