File tree 4 files changed +27
-5
lines changed
4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 1
- use_flake () {
2
- watch_file flake.nix
3
- watch_file flake.lock
4
- eval " $( nix print-dev-env --profile " $( direnv_layout_dir) /flake-profile" ) "
5
- }
1
+ # shellcheck shell=bash
6
2
3
+ if ! has nix_direnv_version || ! nix_direnv_version 2.0.0; then
4
+ source_url " https://raw.githubusercontent.com/nix-community/nix-direnv/2.0.0/direnvrc" " sha256-gMHKKyEOq/T0XmHKgz+pN+fUQC/1EKPAuOtYM95lLnU="
5
+ fi
6
+
7
+ dotenv_if_exists
8
+ nix_direnv_watch_file shell.nix
7
9
use flake
Original file line number Diff line number Diff line change 1
1
# Nix build artifacts
2
2
result
3
+
4
+ # Direnv
5
+ .direnv
Original file line number Diff line number Diff line change 36
36
defaultUser = "zlx" ;
37
37
users = [ defaultUser ] ;
38
38
39
+ pkgs = nixpkgs . legacyPackages . ${ system } ;
40
+
39
41
machines = builtins . attrNames (
40
42
nixpkgs . lib . filterAttrs
41
43
( n : v : v == "directory" )
85
87
nixosConfigurations = builtins . listToAttrs ( builtins . map ( makeMachineConfig defaultUser ) machines ) ;
86
88
homeConfigurations = builtins . listToAttrs ( builtins . map makeHomeConfig users ) ;
87
89
nixOnDroidConfigurations = { device = makeNixOnDroidConfig defaultUser ; } ;
90
+ devShells . "${ system } " . default = import ./shell.nix { inherit pkgs ; } ;
88
91
} ;
89
92
}
Original file line number Diff line number Diff line change
1
+ { pkgs } : with pkgs ;
2
+ mkShell {
3
+ buildInputs = [
4
+ figlet
5
+ ] ;
6
+
7
+ shellHook = ''
8
+ local remote_url="$(git config --get remote.origin.url)"
9
+ project_path=$(echo "$remote_url" | sed -E 's"(git@|.+://)[^:/]+[:/](.+)/.+$"\2"')
10
+ repo_name=$(echo "$remote_url" | sed -E -e 's|.+/(.+)$|\1|' -e 's|(.+)(.git)$|\1|')
11
+
12
+ figlet "Welcome to $project_path's $repo_name"
13
+ '' ;
14
+ }
You can’t perform that action at this time.
0 commit comments