Moved nix files from home-manager to flake to be more generalized

This commit is contained in:
Tyler Mayoff 2024-11-06 20:24:19 -05:00
parent d65ec62e43
commit 6b848b363a
21 changed files with 2 additions and 2 deletions

222
dot_config/flake/flake.lock generated Normal file
View file

@ -0,0 +1,222 @@
{
"nodes": {
"crane": {
"locked": {
"lastModified": 1727974419,
"narHash": "sha256-WD0//20h+2/yPGkO88d2nYbb23WMWYvnRyDQ9Dx4UHg=",
"owner": "ipetkov",
"repo": "crane",
"rev": "37e4f9f0976cb9281cd3f0c70081e5e0ecaee93f",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"helix": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1730790589,
"narHash": "sha256-xJ6bQ4VmdTB7A+dMbmOMaZ8a6erB6rkZkB+yzqD7gd4=",
"owner": "helix-editor",
"repo": "helix",
"rev": "b53dafe326d51b7f64a1c52379e3d4150cd2991e",
"type": "github"
},
"original": {
"owner": "helix-editor",
"repo": "helix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730837930,
"narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f607e07f3ac7e53541120536708e824acccfaa8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1728018373,
"narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bc947f541ae55e999ffdb4013441347d83b00feb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"helix": "helix",
"home-manager": "home-manager",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1728268235,
"narHash": "sha256-lJMFnMO4maJuNO6PQ5fZesrTmglze3UFTTBuKGwR1Nw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "25685cc2c7054efc31351c172ae77b21814f2d42",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,62 @@
{
description = "Home manager flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl.url = "github:nix-community/nixGL";
helix.url = "github:helix-editor/helix";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
system = "x86_64-linux";
in rec {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
overlays = import ./overlays {inherit inputs;};
defaultPackage.${system} = home-manager.defaultPackage.${system};
nixosConfigurations = {
mal = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [./nixos/mal/configuration.nix];
};
};
homeConfigurations = {
"tyler@guidebolt" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home/guidebolt/guidebolt.nix];
};
"tyler@wash" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home/wash/wash.nix];
};
"tyler@mal" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home/mal/mal.nix];
};
};
};
}

View file

@ -0,0 +1,161 @@
{
inputs,
outputs,
# lib,
# config,
pkgs,
...
}: {
nixpkgs.config.allowUnfree = true;
home.username = "tyler";
home.homeDirectory = "/home/tyler";
home.enableNixpkgsReleaseCheck = false;
xdg.enable = true;
imports = [
./fish.nix
./nushell.nix
# ./nom.nix
# ./neovim.nix
];
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
inputs.helix.overlays.default
];
};
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# Fonts
(nerdfonts.override {fonts = ["JetBrainsMono"];})
unstable.nix-output-monitor
# dotfiles
age
unstable.chezmoi
# backup
restic
libnotify
distrobox
wl-clipboard
usbutils
yadm
# Shell
bash
starship
btop
ripgrep
fh
fd
glow
gitoxide
lnav
fzf
zoxide
# Software Dev
tig
mold
# language servers
efm-langserver
sumneko-lua-language-server
nil
alejandra
lemminx
pylyzer
ltex-ls # Spell checker
];
programs.helix = {
enable = true;
package = inputs.helix.packages.${pkgs.system}.default;
};
programs.bat = {
enable = true;
config = {
theme = "GitHub";
};
};
programs.zellij = {
enable = true;
};
programs.starship = {
enable = true;
};
programs.eza = {
enable = true;
enableFishIntegration = true;
};
programs.direnv = {
enable = true;
};
programs.thefuck = {
enable = true;
enableFishIntegration = true;
enableInstantMode = true;
};
programs.yazi = {
enable = true;
package = pkgs.unstable.yazi;
enableFishIntegration = true;
shellWrapperName = "y";
};
services.darkman = {
enable = true;
package = pkgs.unstable.darkman;
settings = {
lat = 45.408;
lng = -74.159;
};
darkModeScripts = {
helix-editor = ''
sed -i 's/theme = ".*"/theme = "catppuccin_macchiato"/' $HOME/.config/helix/config.toml
'';
alacritty = ''
ln -fs ~/.config/alacritty/themes/catppuccin_macchiato.toml ~/.config/alacritty/themes/_active.toml
touch ~/.config/alacritty/alacritty.toml
'';
};
lightModeScripts = {
helix-editor = ''
sed -i 's/theme = ".*"/theme = "catppuccin_latte"/' $HOME/.config/helix/config.toml
'';
alacritty = ''
ln -fs ~/.config/alacritty/themes/catppuccin_latte.toml ~/.config/alacritty/themes/_active.toml
touch ~/.config/alacritty/alacritty.toml
'';
};
};
home.stateVersion = "23.11";
programs.home-manager.enable = true;
}

View file

@ -0,0 +1,74 @@
{pkgs, ...}: {
programs.fish = {
enable = true;
interactiveShellInit = ''
set -gx EDITOR hx
set -gx GIT_EDITOR $EDITOR
set -gx DEBEMAIL "tyler@tylermayoff.com"
fish_add_path $HOME/.local/bin
source $HOME/.config/fish/variables-$(hostname).fish
bind \cz 'fg 2>/dev/null; commandline -f repaint'
zoxide init fish | source
'';
shellInit = ''
set -gx EDITOR hx
set -gx GIT_EDITOR $EDITOR
set -gx DEBEMAIL "tyler@tylermayoff.com"
set -xg XDG_DATA_DIRS "$HOME/.nix-profile/share:$XDG_DATA_DIRS"
fish_add_path $HOME/.local/bin
source $HOME/.config/fish/variables-$(hostname).fish
'';
# functions = {
# yupdate = {
# body = ''
# echo "Hello world"
# '';
# };
# };
plugins = [
{
name = "forgit";
src = pkgs.fishPlugins.forgit.src;
}
];
shellAliases = {
# ls
ls = "eza $eza_params";
l = "eza --git-ignore $eza_params";
ll = "eza --all --header --long $eza_params";
llm = "eza --all --header --long --sort=modified $eza_params";
la = "eza -lbhHigUmuSa";
lx = "eza -lbhHigUmuSa@";
lt = "eza --tree $eza_params";
tree = "eza --tree $eza_params";
# Git
gc = "git commit";
gcm = "git commit -m";
gac = "git add . && git commit";
gacp = "gac && git push";
gs = "git status";
# yac = "yadm add . && yadm commit";
# yacp = "yac && yadm push";
yc = "pushd $HOME/.local/share/yadm/repo.git && git-forgit add && yadm commit && popd";
yd = "pushd $HOME/.local/share/yadm/repo.git && git-forgit diff && popd";
# nix
flake = "nix flake";
# home-manager
hm-upgrade = "nix flake update --flake ~/.config/flake#";
hm-update = "home-manager switch --flake ~/.config/flake";
};
};
}

View file

@ -0,0 +1,18 @@
{pkgs, ...}: {
home.packages = with pkgs; [
gnome.gnome-tweaks
];
programs.gnome-shell = {
enable = true;
extensions = [
{package = pkgs.gnomeExtensions.appindicator;}
{package = pkgs.gnomeExtensions.ddterm;}
{package = pkgs.gnomeExtensions.alphabetical-app-grid;}
{package = pkgs.gnomeExtensions.gsconnect;}
{package = pkgs.gnomeExtensions.paperwm;}
{package = pkgs.gnomeExtensions.night-theme-switcher;}
{package = pkgs.gnomeExtensions.blur-my-shell;}
];
};
}

View file

@ -0,0 +1,46 @@
{
inputs,
config,
pkgs,
...
}: {
imports = [
];
nixGL.packages = inputs.nixgl.packages;
nixGL.defaultWrapper = "mesa";
# nixGL.offloadWrapper = "nvidiaPrime";
nixGL.installScripts = ["mesa"];
home.packages = with pkgs; [
adw-gtk3
discord
# Office
libreoffice
obsidian
];
# programs.vscode.enable = true;
programs.alacritty = {
enable = true;
package = config.lib.nixGL.wrap pkgs.alacritty;
};
programs.wezterm = {
enable = false;
package = config.lib.nixGL.wrap pkgs.wezterm;
extraConfig = ''
return {
font_size=9.25,
color_scheme="catppuccin-latte",
hide_tab_bar_if_only_one_tab = true,
window_frame = {
font_size = 10
},
}
'';
};
}

View file

@ -0,0 +1,16 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [../common.nix];
home.packages = with pkgs; [
# clang_17
# clang-tools
just
];
}

View file

@ -0,0 +1,24 @@
{
# inputs,
# outputs,
# lib,
config,
# pkgs,
...
}: {
systemd.user.services = {
daily_backup = {
Unit = {
Description = "Run a backup script";
};
Install = {
WantedBy = ["default.target"];
};
Service = {
Type = "oneshot";
ExecStart = "${config.home.homeDirectory}/.local/bin/,daily_backup";
};
};
};
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
imports = [../common.nix];
}

View file

@ -0,0 +1,187 @@
{ config, pkgs, lib, ... }:
let
collectPathArgs = ''
paths=()
while [ "$#" -gt 0 ]; do
arg="$1"
[[ "$arg" =~ ^--?.+ ]] && break
paths+=("$arg"); shift
done
'';
pathArgs = ''"''${paths[@]}"'';
collectFlakeFlags = ''
flakeFlags=()
while [ "$#" -gt 0 ]; do
arg="$1"
case "$arg" in
${
builtins.concatStringsSep "|" [
"build"
"bundle"
"copy"
"daemon"
"derivation"
"develop"
"doctor"
"edit"
"eval"
"flake"
"fmt"
"hash"
"help"
"help-stores"
"key"
"log"
"nar"
"path-info"
"print-dev-env"
"profile"
"realisation"
"registry"
"repl"
"run"
"search"
"shell"
"show-config"
"store"
"upgrade-nix"
"why-depends"
]
})
break
;;
*)
flakeFlags+=("$arg"); shift
;;
esac
done
'';
flakeFlags = ''"''${flakeFlags[@]}"'';
nixNomArgs = "--log-format internal-json --verbose";
nixBuildCmdWithNomArgs = buildCmd: ''
${collectPathArgs}
${buildCmd} ${pathArgs} ${nixNomArgs} "$@"
'';
nixShellCmdWithNomArgs = shellCmd: ''
${shellCmd} ${nixNomArgs} "$@"
'';
nixStoreCmdWithNomArgs = storeCmd: ''
operation="$1"; shift
case "$operation" in
--realise|-r)
${collectPathArgs}
${storeCmd} "$operation" ${pathArgs} ${nixNomArgs} "$@"
;;
*)
${storeCmd} "$operation" "$@"
;;
esac
'';
nixWithNomArgs = nix:
pkgs.symlinkJoin {
name = "nix-with-nom-args-${nix.version}";
paths = (lib.attrsets.mapAttrsToList pkgs.writeShellScriptBin {
nix = ''
program="$(basename $0)"
case "$program" in
nix)
${collectFlakeFlags}
command="$1"; shift
case "$command" in
build)
${nixBuildCmdWithNomArgs "${nix}/bin/nix ${flakeFlags} build"}
;;
shell)
${nixShellCmdWithNomArgs "${nix}/bin/nix ${flakeFlags} shell"}
;;
store)
${nixStoreCmdWithNomArgs "${nix}/bin/nix ${flakeFlags} store"}
;;
*)
${nix}/bin/nix ${flakeFlags} "$command" "$@"
;;
esac
;;
*)
"${nix}/bin/$program" "$@"
;;
esac
'';
# nix-build = nixBuildCmdWithNomArgs "${nix}/bin/nix-build";
nix-shell = nixShellCmdWithNomArgs "${nix}/bin/nix-shell";
nix-store = nixStoreCmdWithNomArgs "${nix}/bin/nix-store";
}) ++ [ nix ];
};
nixNomPkgs = { nix ? null, nixos-rebuild ? null, home-manager ? null }:
lib.attrsets.mapAttrs pkgs.writeShellScriptBin ((if nix != null then {
nix = ''
program="$(basename $0)"
case "$program" in
nix)
${collectFlakeFlags}
command="$1"; shift
case "$command" in
build|shell|develop)
${pkgs.nix-output-monitor}/bin/nom ${flakeFlags} "$command" "$@"
;;
*)
${nix}/bin/nix ${flakeFlags} "$command" "$@"
;;
esac
;;
*)
"${nix}/bin/$program" "$@"
;;
esac
'';
# nix-build = ''
# ${pkgs.nix-output-monitor}/bin/nom-build "$@"
# '';
nix-shell = ''
${pkgs.nix-output-monitor}/bin/nom-shell "$@"
'';
nix-store = ''
${nixWithNomArgs nix}/bin/nix-store "$@" \
|& ${pkgs.nix-output-monitor}/bin/nom --json
'';
} else
{ }) // (if nixos-rebuild != null then {
nixos-rebuild = ''
${pkgs.expect}/bin/unbuffer \
${
nixos-rebuild.override (old: { nix = nixWithNomArgs old.nix; })
}/bin/nixos-rebuild "$@" \
|& ${pkgs.nix-output-monitor}/bin/nom --json
'';
} else
{ }) // (if home-manager != null then {
home-manager = ''
PATH="${nixWithNomArgs pkgs.nix}/bin:$PATH" \
${pkgs.expect}/bin/unbuffer \
${home-manager}/bin/home-manager "$@" \
|& ${pkgs.nix-output-monitor}/bin/nom --json
'';
} else
{ }));
nomAliases = pkgs:
lib.attrsets.mapAttrs (name: pkg: "${pkg}/bin/${name}") (nixNomPkgs pkgs);
wrapWithNom = let inherit (pkgs) symlinkJoin;
in (pkgs:
symlinkJoin {
name = "wrapped-with-nom";
paths = (builtins.attrValues (nixNomPkgs pkgs))
++ (builtins.attrValues pkgs);
});
in {
# home.shellAliases =
# nomAliases { inherit (pkgs) nix nixos-rebuild home-manager; };
# or
# home.packages = [
# (lib.hiPrio
# (wrapWithNom { inherit (pkgs) nix nixos-rebuild home-manager; }))
# ];
}

View file

@ -0,0 +1,44 @@
{pkgs, ...}: {
programs.nushell = {
enable = true;
envFile = {
text = ''
$env.EDITOR = hx
$env.GIT_EDITOR = $env.EDITOR
$env.DEBMAIL = "tyler@tylermayoff.com"
$env.XDG_CONFIG_HOME = "$HOME/.config"
$env.XDG_CACHE_HOME = "$HOME/.cache"
$env.XDG_DATA_HOME = "$HOME/.local/share"
$env.XDG_STATE_HOME = "$HOME/.local/state"
zoxide init nushell | save -f ~/.config/nushell/zoxide.nu
'';
};
shellAliases = {
# Git
gc = "git commit";
gcm = "git commit -m";
gac = "git add . and git commit";
gacp = "gac and git push";
gs = "git status";
yac = "yadm add --interactive and yadm commit";
yacp = "yac and yadm push";
# nix
flake = "nix flake";
# home-manager
hm-upgrade = "nix flake update --flake ~/.config/home-manager/";
hm-update = "home-manager switch --impure";
};
configFile = {
text = ''
source ~/.config/nushell/zoxide.nu
'';
};
};
}

View file

@ -0,0 +1,7 @@
{pkgs, ...}: {
imports = [../common.nix ../gnome.nix ../home-backup.nix ../gui.nix];
home.packages = with pkgs; [
ventoy
];
}

View file

@ -0,0 +1,52 @@
{pkgs, ...}: {
programs.neovim = {
# package = pkgs.neovim-nightly;
enable = false;
defaultEditor = false;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
# Color schemes
rose-pine
gruvbox-nvim
cmp-buffer
cmp-path
cmp_luasnip
cmp-nvim-lua
cmp-nvim-lsp
friendly-snippets
glow-nvim
nvim-tree-lua
luasnip
lsp-zero-nvim
nvim-dap
nvim-dap-ui
copilot-vim
todo-comments-nvim
nvim-treesitter-context
nvim-treesitter.withAllGrammars
nvim-lspconfig
nvim-cmp
harpoon
undotree
#mini-nvim
formatter-nvim
telescope-nvim
vim-fugitive
vim-just
];
#extraConfig = ''
# builtins.readFile /home/jayne/.config/nvim/extra_init.vim
#'';
};
}

View file

@ -0,0 +1,192 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{
inputs,
outputs,
# config,
lib,
pkgs,
...
}: let
secrets = builtins.readFile ./secrets.sh;
in {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = ["nix-command" "flakes"];
};
channel.enable = false;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-curses;
enableSSHSupport = true;
};
networking.hostName = "mal"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
# time.timeZone = "Europe/Amsterdam";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# hardware.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.tyler = {
isNormalUser = true;
extraGroups = ["wheel"]; # Enable sudo for the user.
shell = pkgs.fish;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
helix # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
yadm
restic
git
chezmoi
pinentry-curses
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
systemd.timers."backup-serenity" = {
timerConfig = {
OnCalendar = "monthly";
Persistent = true;
Unit = "backup-serenity.service";
};
};
systemd.services."backup-serenity" = {
script = ''
# Remove keys
${secrets}
printf "\nBacking up nextcloud \n"
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/NextCloud" backup --verbose --no-scan /mnt/user/NextCloud
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/NextCloud" check --verbose
printf "\nBacking up Backups \n"
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/Backups" backup --verbose --no-scan /mnt/user/Backups
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/Backups" check --verbose
printf "\nBacking up appdata \n"
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/Appdata" backup --verbose --no-scan /mnt/user/appdata
${pkgs.restic}/bin/restic -r "$RESTIC_REPOSITORY/Appdata" check --verbose
'';
serviceConfig = {
Type = "simple";
User = "root";
};
};
programs.fish.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,13 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAwQW1XRFcwWUlUR0dDUkdl
WXFiamhsc0FGU3R6NDhMTTRjYllRTlR4MGxrCnpjbzQzSXJ2VU9oWGFiTTNlMGZY
Y3ZQSUdpUVh4bWFCZVAxNTR2V2VWd28KLS0tIFlHck11dEVyVFdxcVdsY2tVT1hs
Q1pWNWtZOGhZTTJBSGd2VlZmeTNBZTQK9bx0M1AecvHhyWDvwkh0ngY7Wvzx3XvY
LLG4avljxdm80KmwdWyNQquCI9iYrwwVp+vM/O4kPHul1gBGNXw3BlsihaLrqzGO
0NtiXEf8t/HNwFxaLCYO1SbcOkId44iXFDUnNlzf+Xvx+XPVM2l0KehZz38OCcIu
8Q0MVdADp3VOIaUtIqn0JUVPQlJUPnsJTmDpIZ8wvRHn4+9n4goPacVZuxUy/EQ2
XtDRqbdP2grheQR6i5ICqu4uhpPMlPbde5BpkDTm8Zk53wonrZyYkqRxeupFkkeb
5VO+fo7r6s3HN2xI5vSAA0/PLFswd2KBQdSWmck6gvLJtikeDr6eyBEAcCIeDpPD
fFQ+ejr3xMGUmwwR/kR4OIHuHlAS02Ja1VIOuDp7Nd95eI85wbuxJ3F4Gc56eg9h
CbScScf4iLc=
-----END AGE ENCRYPTED FILE-----

View file

@ -0,0 +1,46 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/b44df0dd-174f-47b0-af88-fd66c6e7deb5";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5564-A778";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
fileSystems."/mnt/user" = {
device = "array";
fsType = "9p";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.nushell = {
enable = true;
envFile = ''
$env.EDITOR = hx
$env.GIT_EDITOR = $env.EDITOR
$env.DEBMAIL = "tyler@tylermayoff.com"
$env.XDG_CONFIG_HOME = "$HOME/.config"
$env.XDG_CACHE_HOME = "$HOME/.cache"
$env.XDG_DATA_HOME = "$HOME/.local/share"
$env.XDG_STATE_HOME = "$HOME/.local/state"
'';
};
}

View file

@ -0,0 +1,15 @@
{inputs, ...}: {
additions = final: _prev: import ../pkgs final.pkgs;
modifications = final: prev: {
mods = {
};
};
unstable-packages = final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

View file

@ -0,0 +1,2 @@
final: prev: {
}

View file

@ -0,0 +1,2 @@
pkgs: {
}

View file

@ -0,0 +1 @@
/nix/store/x4vzxk2s9vr08kb9iybhhjy4nvsy4zgj-home-manager