a little refactoring to prepare for the vps

This commit is contained in:
Lillian Violet 2023-11-19 23:12:21 +01:00
parent cbf77c4cbe
commit 012ba5e6f4
5 changed files with 233 additions and 83 deletions

View file

@ -81,5 +81,16 @@
];
};
};
nixosConfigurations = {
queen = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/queen/configuration.nix
sops-nix.nixosModules.sops
];
};
};
};
}

View file

@ -6,6 +6,18 @@
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
./program-configs/zsh.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
@ -106,89 +118,6 @@
];
};
programs.zsh = {
enable = true;
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.7.0";
sha256 = "149zh2rm59blr2q458a5irkfh82y3dwdich60s9670kl3cl5h2m1";
};
}
];
enableAutosuggestions = true;
enableCompletion = true;
historySubstringSearch.enable = true;
syntaxHighlighting.enable = true;
zsh-abbr.enable = true;
oh-my-zsh = {
enable = true;
plugins = [
"git"
"adb"
"battery"
"branch"
"coffee"
"colored-man-pages"
"colorize"
"command-not-found"
"common-aliases"
"compleat"
"composer"
"copypath"
"copybuffer"
"copyfile"
"cp"
"dirhistory"
"dirpersist"
"docker"
"docker-compose"
"extract"
"fancy-ctrl-z"
"fastfile"
"frontend-search"
"git-auto-fetch"
"git-escape-magic"
"git-extras"
"git-flow"
"github"
"gitignore"
"gnu-utils"
"gpg-agent"
"history"
"history-substring-search"
"isodate"
"jsontools"
"keychain"
"man"
"nanoc"
"pip"
"pipenv"
"pyenv"
"python"
"rsync"
"rvm"
"screen"
"sdk"
"sfdx"
"shell-proxy"
"sudo"
"systemadmin"
"systemd"
"themes"
"urltools"
"web-search"
"zsh-interactive-cd"
"zsh-navigation-tools"
];
theme = "jtriley";
};
};
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git = {

View file

@ -0,0 +1,91 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
programs.zsh = {
enable = true;
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.7.0";
sha256 = "149zh2rm59blr2q458a5irkfh82y3dwdich60s9670kl3cl5h2m1";
};
}
];
enableAutosuggestions = true;
enableCompletion = true;
historySubstringSearch.enable = true;
syntaxHighlighting.enable = true;
zsh-abbr.enable = true;
oh-my-zsh = {
enable = true;
plugins = [
"git"
"adb"
"battery"
"branch"
"coffee"
"colored-man-pages"
"colorize"
"command-not-found"
"common-aliases"
"compleat"
"composer"
"copypath"
"copybuffer"
"copyfile"
"cp"
"dirhistory"
"dirpersist"
"docker"
"docker-compose"
"extract"
"fancy-ctrl-z"
"fastfile"
"frontend-search"
"git-auto-fetch"
"git-escape-magic"
"git-extras"
"git-flow"
"github"
"gitignore"
"gnu-utils"
"gpg-agent"
"history"
"history-substring-search"
"isodate"
"jsontools"
"keychain"
"man"
"nanoc"
"pip"
"pipenv"
"pyenv"
"python"
"rsync"
"rvm"
"screen"
"sdk"
"sfdx"
"shell-proxy"
"sudo"
"systemadmin"
"systemd"
"themes"
"urltools"
"web-search"
"zsh-interactive-cd"
"zsh-navigation-tools"
];
theme = "jtriley";
};
};
}

View file

@ -0,0 +1,26 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
./program-configs/zsh.nix
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.11";
}

View file

@ -0,0 +1,93 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
};
environment.systemPackages = with pkgs; [
age
alejandra
git-filter-repo
home-manager
noto-fonts
noto-fonts-emoji-blob-bin
noto-fonts-emoji
oh-my-zsh
rsync
wget
zsh
];
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8";
};
programs.zsh = {
enable = true;
};
users.users = {
lillian = {
isNormalUser = true;
extraGroups = ["sudo" "networkmanager" "wheel" "vboxsf"];
shell = pkgs.zsh;
};
};
# Enable completion of system packages by zsh
environment.pathsToLink = ["/share/zsh"];
home-manager = {
extraSpecialArgs = {inherit inputs outputs;};
users = {
# Import your home-manager configuration
lillian = import ../../home-manager/queen-Lillian.nix;
};
};
networking.hostName = "queen";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "unstable";
}