diff options
Diffstat (limited to 'nixos/profiles/common')
-rw-r--r-- | nixos/profiles/common/basics.nix | 35 | ||||
-rw-r--r-- | nixos/profiles/common/default.nix | 8 | ||||
-rw-r--r-- | nixos/profiles/common/nixpkgs/config.nix | 4 | ||||
-rw-r--r-- | nixos/profiles/common/nixpkgs/overlays.nix | 4 | ||||
-rw-r--r-- | nixos/profiles/common/sanix.nix | 24 |
5 files changed, 75 insertions, 0 deletions
diff --git a/nixos/profiles/common/basics.nix b/nixos/profiles/common/basics.nix new file mode 100644 index 0000000..aa6eff9 --- /dev/null +++ b/nixos/profiles/common/basics.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + git + vim + + file + htop + ripgrep + tree + # TODO: use a tree alternative that understands .gitignore + wget + ]; + + users.defaultUserShell = pkgs.zsh; + programs.zsh = { + enable = true; + + # Disabling compinit in /etc/zshrc so that we can call + # compinit with a custom zcompdump location in .zshrc. + enableGlobalCompInit = false; + }; + + environment.sessionVariables = + let + config = "$HOME/config/user"; + in + { + # Set environment variables for software that doesn't + # follow the XDG Base Directory specification. + + ZDOTDIR = "${config}/zsh"; + }; +} diff --git a/nixos/profiles/common/default.nix b/nixos/profiles/common/default.nix new file mode 100644 index 0000000..de4499a --- /dev/null +++ b/nixos/profiles/common/default.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./sanix.nix + ./basics.nix + ]; +} diff --git a/nixos/profiles/common/nixpkgs/config.nix b/nixos/profiles/common/nixpkgs/config.nix new file mode 100644 index 0000000..b53485a --- /dev/null +++ b/nixos/profiles/common/nixpkgs/config.nix @@ -0,0 +1,4 @@ +# https://nixos.org/manual/nixpkgs/stable/#chap-packageconfig +{ + +} diff --git a/nixos/profiles/common/nixpkgs/overlays.nix b/nixos/profiles/common/nixpkgs/overlays.nix new file mode 100644 index 0000000..613338f --- /dev/null +++ b/nixos/profiles/common/nixpkgs/overlays.nix @@ -0,0 +1,4 @@ +# https://nixos.org/manual/nixpkgs/stable/#sec-overlays-definition +[ + +] diff --git a/nixos/profiles/common/sanix.nix b/nixos/profiles/common/sanix.nix new file mode 100644 index 0000000..a20db24 --- /dev/null +++ b/nixos/profiles/common/sanix.nix @@ -0,0 +1,24 @@ +{ lib, pkgs, config, ... }: { + # Use the Nixpkgs config and overlays from the local files for this NixOS build + nixpkgs = { + config = import ./nixpkgs/config.nix; + overlays = import ./nixpkgs/overlays.nix; + }; + + # Makes commands default to the same Nixpkgs, config, overlays and NixOS configuration + nix.nixPath = [ + "nixpkgs=${pkgs.path}" + "nixos-config=${toString <nixos-config>}" + "nixpkgs-overlays=${toString ./nixpkgs/overlays.nix}" + ]; + environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix); + + # Remove the stateful nix-channel command + environment.extraSetup = '' + rm --force $out/bin/nix-channel + ''; + + # This option is broken when set false, prevent people from setting it to false + # And we implement the important bit above ourselves + nix.channel.enable = true; +} |