mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat: lurching towards relative usability
This commit is contained in:
parent
a0fb7eb402
commit
961ec369ba
51 changed files with 1349 additions and 407 deletions
1
.envrc
1
.envrc
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
||||||
1
darwin/modules/blank.nix
Normal file
1
darwin/modules/blank.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
_: {}
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
}
|
|
||||||
|
|
@ -3,5 +3,7 @@ let
|
||||||
self = import ./outputs.nix ({
|
self = import ./outputs.nix ({
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
system = builtins.currentSystem;
|
system = builtins.currentSystem;
|
||||||
} // inputs);
|
}
|
||||||
in self
|
// inputs);
|
||||||
|
in
|
||||||
|
self
|
||||||
|
|
|
||||||
53
flake.lock
generated
53
flake.lock
generated
|
|
@ -90,21 +90,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1644229661,
|
|
||||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -153,6 +138,26 @@
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-index-database": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673752441,
|
||||||
|
"narHash": "sha256-/g4ImZWV05CrXRWTSJsda6ztIp7LAPxs2L6RCrbQ66U=",
|
||||||
|
"owner": "Mic92",
|
||||||
|
"repo": "nix-index-database",
|
||||||
|
"rev": "391180f77505c1c8cdd45fe1a59dc89d3e40300a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Mic92",
|
||||||
|
"repo": "nix-index-database",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670064435,
|
"lastModified": 1670064435,
|
||||||
|
|
@ -218,6 +223,7 @@
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mach-nix": "mach-nix",
|
"mach-nix": "mach-nix",
|
||||||
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"pypi-deps-db": "pypi-deps-db",
|
"pypi-deps-db": "pypi-deps-db",
|
||||||
"ragenix": "ragenix",
|
"ragenix": "ragenix",
|
||||||
|
|
@ -310,20 +316,17 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"utils_2": {
|
"utils_2": {
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils"
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1657226504,
|
"lastModified": 1667395993,
|
||||||
"narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
"owner": "gytis-ivaskevicius",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils-plus",
|
"repo": "flake-utils",
|
||||||
"rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "gytis-ivaskevicius",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils-plus",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
flake.nix
25
flake.nix
|
|
@ -1,25 +1,33 @@
|
||||||
{
|
{
|
||||||
description = "kat's personal system flakes";
|
description = "the katzian monorepo effort";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
# to allow non-nix 2.4 evaluation
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
url = "github:edolstra/flake-compat";
|
url = "github:edolstra/flake-compat";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
# used for overriding unwanted flake inputs
|
||||||
empty.url = "github:input-output-hk/empty-flake";
|
empty.url = "github:input-output-hk/empty-flake";
|
||||||
|
# self-explanatory
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
# self-explanatory
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/master";
|
url = "github:nix-community/home-manager/master";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
# self-explanatory
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/master";
|
url = "github:lnl7/nix-darwin/master";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
# flake-utils
|
||||||
|
utils.url = "github:numtide/flake-utils";
|
||||||
|
# file structure -> attrset
|
||||||
tree = {
|
tree = {
|
||||||
url = "github:kittywitch/tree";
|
url = "github:kittywitch/tree";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
# secrets
|
||||||
ragenix = {
|
ragenix = {
|
||||||
url = "github:yaxitech/ragenix";
|
url = "github:yaxitech/ragenix";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
@ -27,20 +35,23 @@
|
||||||
flake-utils.follows = "utils";
|
flake-utils.follows = "utils";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# secrets templating
|
||||||
scalpel = {
|
scalpel = {
|
||||||
url = "github:polygon/scalpel";
|
url = "github:polygon/scalpel";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
# i get that you have to test shit, but isn't throwing sops-nix and thus three
|
# i get that you have to test shit, but isn't throwing sops-nix and thus three
|
||||||
# whole fucking versions of nixpkgs into shit a little excessive?
|
# whole fucking versions of nixpkgs into shit a little excessive?
|
||||||
# fuck the sops-nix people to begin with :/
|
# making people have to stub this out unless they want to deal with importing that is a pain
|
||||||
sops-nix.follows = "empty";
|
sops-nix.follows = "empty";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# dependency database for mach-nix
|
||||||
pypi-deps-db = {
|
pypi-deps-db = {
|
||||||
url = "github:DavHau/pypi-deps-db";
|
url = "github:DavHau/pypi-deps-db";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
# nixified python environments
|
||||||
mach-nix = {
|
mach-nix = {
|
||||||
url = "mach-nix/3.5.0";
|
url = "mach-nix/3.5.0";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
@ -49,10 +60,16 @@
|
||||||
pypi-deps-db.follows = "pypi-deps-db";
|
pypi-deps-db.follows = "pypi-deps-db";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# pre-computed nix-index
|
||||||
|
nix-index-database = {
|
||||||
|
url = "github:Mic92/nix-index-database";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
# a bunch of modules (also arcnmx is good)
|
||||||
arcexprs = {
|
arcexprs = {
|
||||||
url = "github:arcnmx/nixexprs/master";
|
url = "github:arcnmx/nixexprs/master";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
outputs = { ... }@inputs: import ./outputs.nix inputs;
|
outputs = inputs: import ./outputs.nix inputs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
41
home/base16.nix
Normal file
41
home/base16.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
base16 = {
|
||||||
|
vim.enable = false;
|
||||||
|
vim.template = data: let
|
||||||
|
drv = pkgs.base16-templates.vim.withTemplateData data;
|
||||||
|
in drv.overrideAttrs (old: {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
repo = "base16-vim";
|
||||||
|
owner = "fnune";
|
||||||
|
rev = "52e4ce93a6234d112bc88e1ad25458904ffafe61";
|
||||||
|
sha256 = "10y8z0ycmdjk47dpxf6r2pc85k0y19a29aww99vgnxp31wrkc17h";
|
||||||
|
};
|
||||||
|
patches = old.patches or [ ] ++ [
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
# base16background=none
|
||||||
|
url = "https://github.com/arcnmx/base16-vim/commit/fe16eaaa1de83b649e6867c61494276c1f35c3c3.patch";
|
||||||
|
sha256 = "1c0n7mf6161mvxn5xlabhyxzha0m1c41csa6i43ng8zybbspipld";
|
||||||
|
})
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
# fix unreadable error highlights under cursor
|
||||||
|
url = "https://github.com/arcnmx/base16-vim/commit/807e442d95c57740dd3610c9f9c07c9aae8e0995.patch";
|
||||||
|
sha256 = "1l3qmk15v8d389363adkmfg8cpxppyhlk215yq3rdcasvw7r8bla";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
});
|
||||||
|
shell.enable = true;
|
||||||
|
schemes = lib.mkMerge [
|
||||||
|
{
|
||||||
|
light = "atelier.atelier-cave-light";
|
||||||
|
dark = "atelier.atelier-cave";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
dark.ansi.palette.background.alpha = "ee00";
|
||||||
|
light.ansi.palette.background.alpha = "d000";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultSchemeName = "dark";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, ... }: {
|
_: {
|
||||||
home = {
|
home = {
|
||||||
username = "kat";
|
username = "kat";
|
||||||
stateVersion = "22.11";
|
stateVersion = "22.11";
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
in {
|
|
||||||
config = mkIf config.role.development {
|
|
||||||
home.packages = [
|
|
||||||
pkgs.deadnix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
let
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) fixedWidthNumber hasInfix;
|
inherit (lib.strings) fixedWidthNumber hasInfix;
|
||||||
inherit (lib.attrsets) mapAttrs filterAttrs;
|
inherit (lib.attrsets) mapAttrs filterAttrs;
|
||||||
|
|
@ -10,11 +13,13 @@ initLua = pkgs.substituteAll ({
|
||||||
src = ./init.lua;
|
src = ./init.lua;
|
||||||
inherit packDir;
|
inherit packDir;
|
||||||
base16ShellPath = config.base16.shell.package;
|
base16ShellPath = config.base16.shell.package;
|
||||||
defaultSchemeName = config.base16.defaultSchemeName;
|
inherit (config.base16) defaultSchemeName;
|
||||||
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
||||||
} // mapAttrs (_: col: fixedWidthNumber 2 col.ansiIndex)
|
}
|
||||||
|
// mapAttrs (_: col: fixedWidthNumber 2 col.ansiIndex)
|
||||||
(filterAttrs (var: _: hasInfix "base" var) config.base16.defaultScheme));
|
(filterAttrs (var: _: hasInfix "base" var) config.base16.defaultScheme));
|
||||||
in mkIf config.programs.neovim.enable {
|
in
|
||||||
|
mkIf config.programs.neovim.enable {
|
||||||
home.sessionVariables.EDITOR = "nvim";
|
home.sessionVariables.EDITOR = "nvim";
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
|
|
@ -49,7 +54,8 @@ in mkIf config.programs.neovim.enable {
|
||||||
bufferline-nvim
|
bufferline-nvim
|
||||||
# Language Server
|
# Language Server
|
||||||
nvim-lspconfig
|
nvim-lspconfig
|
||||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_: with pkgs.tree-sitter-grammars; [
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_:
|
||||||
|
with pkgs.tree-sitter-grammars; [
|
||||||
tree-sitter-c
|
tree-sitter-c
|
||||||
tree-sitter-lua
|
tree-sitter-lua
|
||||||
tree-sitter-rust
|
tree-sitter-rust
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }: let
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
in {
|
in {
|
||||||
|
|
@ -9,12 +14,5 @@ in {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.wezterm
|
pkgs.wezterm
|
||||||
];
|
];
|
||||||
xdg.configFile."wezterm/wezterm.lua".text = ''
|
|
||||||
local = wezterm = require 'wezterm'
|
|
||||||
return {
|
|
||||||
check_for_updates = false,
|
|
||||||
enable_tab_bar = true
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
role.development = true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
programs.wezterm.enable = true;
|
|
||||||
}
|
|
||||||
12
home/shell/bitw.nix
Normal file
12
home/shell/bitw.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, pkgs, meta, lib, ... }: {
|
||||||
|
programs.rbw = {
|
||||||
|
enable = true;
|
||||||
|
package = lib.mkIf (meta.trusted ? secrets) (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.secrets.repo.bitw.source} "$@"'');
|
||||||
|
settings = {
|
||||||
|
email = "kat@kittywit.ch";
|
||||||
|
base_url = "https://vault.kittywit.ch";
|
||||||
|
identity_url = null;
|
||||||
|
lock_timeout = 3600;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
home/shell/direnv.nix
Normal file
6
home/shell/direnv.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
11
home/shell/exa.nix
Normal file
11
home/shell/exa.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
home.packages = [ pkgs.exa ];
|
||||||
|
|
||||||
|
programs.zsh.shellAliases = {
|
||||||
|
exa = "exa --time-style long-iso";
|
||||||
|
ls = "exa -G";
|
||||||
|
la = "exa -Ga";
|
||||||
|
ll = "exa -l";
|
||||||
|
lla = "exa -lga";
|
||||||
|
};
|
||||||
|
}
|
||||||
10
home/shell/fzf.nix
Normal file
10
home/shell/fzf.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
programs.zsh.plugins = lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) {
|
||||||
|
name = "fzf-tab";
|
||||||
|
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||||
|
};
|
||||||
|
}
|
||||||
29
home/shell/git.nix
Normal file
29
home/shell/git.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
gitAndTools.git-remote-gcrypt
|
||||||
|
git-crypt
|
||||||
|
git-revise
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
package = pkgs.gitAndTools.gitFull;
|
||||||
|
enable = true;
|
||||||
|
userName = "Kat Inskip";
|
||||||
|
userEmail = "kat@inskip.me";
|
||||||
|
extraConfig = {
|
||||||
|
init = { defaultBranch = "main"; };
|
||||||
|
protocol.gcrypt.allow = "always";
|
||||||
|
annex = {
|
||||||
|
autocommit = false;
|
||||||
|
backend = "BLAKE2B512";
|
||||||
|
synccontent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
signing = {
|
||||||
|
key = "0xE8DDE3ED1C90F3A0";
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
21
home/shell/inputrc.nix
Normal file
21
home/shell/inputrc.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
xdg.configFile."inputrc".text = ''
|
||||||
|
set editing-mode vi
|
||||||
|
set keyseq-timeout 1
|
||||||
|
set mark-symlinked-directories on
|
||||||
|
set completion-prefix-display-length 8
|
||||||
|
set show-all-if-ambiguous on
|
||||||
|
set show-all-if-unmodified on
|
||||||
|
set visible-stats on
|
||||||
|
set colored-stats on
|
||||||
|
set bell-style audible
|
||||||
|
set meta-flag on
|
||||||
|
set input-meta on
|
||||||
|
set convert-meta off
|
||||||
|
set output-meta on
|
||||||
|
'';
|
||||||
|
|
||||||
|
home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc";
|
||||||
|
}
|
||||||
19
home/shell/lc.nix
Normal file
19
home/shell/lc.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
home.language = let
|
||||||
|
ca = "en_CA.UTF-8";
|
||||||
|
dk = "en_DK.UTF-8";
|
||||||
|
in {
|
||||||
|
base = ca;
|
||||||
|
ctype = ca;
|
||||||
|
time = ca;
|
||||||
|
numeric = ca;
|
||||||
|
collate = ca;
|
||||||
|
monetary = ca;
|
||||||
|
messages = ca;
|
||||||
|
paper = ca;
|
||||||
|
name = ca;
|
||||||
|
address = ca;
|
||||||
|
telephone = ca;
|
||||||
|
measurement = ca;
|
||||||
|
};
|
||||||
|
}
|
||||||
32
home/shell/packages.nix
Normal file
32
home/shell/packages.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# task managers
|
||||||
|
htop
|
||||||
|
btop
|
||||||
|
# disk usage
|
||||||
|
duc-cli
|
||||||
|
# nix formatting
|
||||||
|
nixpkgs-fmt
|
||||||
|
# show type of files
|
||||||
|
file
|
||||||
|
# command monitoring
|
||||||
|
pv
|
||||||
|
# cat but better
|
||||||
|
bat
|
||||||
|
# ls replacement
|
||||||
|
exa
|
||||||
|
# sed replacement
|
||||||
|
sd
|
||||||
|
# find replacement
|
||||||
|
fd
|
||||||
|
# ripgrep / grep replacement
|
||||||
|
ripgrep
|
||||||
|
# remote tmux
|
||||||
|
tmate
|
||||||
|
# remote utilities
|
||||||
|
socat
|
||||||
|
rsync
|
||||||
|
wget
|
||||||
|
whois
|
||||||
|
];
|
||||||
|
}
|
||||||
39
home/shell/rink.nix
Normal file
39
home/shell/rink.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
#rink-readline TODO: wait for fix
|
||||||
|
rink
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.configFile."rink/config.toml".text = lib.toTOML {
|
||||||
|
colors = {
|
||||||
|
enabled = true;
|
||||||
|
theme = "my_theme";
|
||||||
|
};
|
||||||
|
currency = {
|
||||||
|
cache_duration = "1h";
|
||||||
|
enabled = true;
|
||||||
|
endpoint = "https://rinkcalc.app/data/currency.json";
|
||||||
|
timeout = "2s";
|
||||||
|
};
|
||||||
|
rink = {
|
||||||
|
long_output = true;
|
||||||
|
prompt = "> ";
|
||||||
|
};
|
||||||
|
themes = {
|
||||||
|
my_theme = {
|
||||||
|
date_time = "default";
|
||||||
|
doc_string = "italic";
|
||||||
|
error = "red";
|
||||||
|
number = "default";
|
||||||
|
plain = "default";
|
||||||
|
pow = "default";
|
||||||
|
prop_name = "cyan";
|
||||||
|
quantity = "dimmed cyan";
|
||||||
|
unit = "cyan";
|
||||||
|
user_input = "bold";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
11
home/shell/ssh.nix
Normal file
11
home/shell/ssh.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ meta, config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
controlMaster = "auto";
|
||||||
|
controlPersist = "10m";
|
||||||
|
hashKnownHosts = true;
|
||||||
|
compression = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
6
home/shell/starship.nix
Normal file
6
home/shell/starship.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
50
home/shell/tmux.nix
Normal file
50
home/shell/tmux.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zsh.shellAliases = {
|
||||||
|
tt = "tmux new -AD -s";
|
||||||
|
};
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
terminal = "tmux-256color";
|
||||||
|
keyMode = "vi";
|
||||||
|
baseIndex = 1;
|
||||||
|
extraConfig = with lib.mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; ''
|
||||||
|
# proper title handling
|
||||||
|
set -g set-titles on
|
||||||
|
set -g set-titles-string "#T"
|
||||||
|
set -ga terminal-overrides ",xterm-256color:Tc"
|
||||||
|
|
||||||
|
# modes
|
||||||
|
setw -g clock-mode-colour colour8
|
||||||
|
setw -g mode-style 'fg=${base07} bg=${base02} bold'
|
||||||
|
|
||||||
|
# panes
|
||||||
|
set -g pane-border-style 'fg=${base06} bg=${base02}'
|
||||||
|
set -g pane-active-border-style 'bg=${base0D} fg=${base07}'
|
||||||
|
|
||||||
|
# statusbar
|
||||||
|
set -g status-position bottom
|
||||||
|
set -g status-justify left
|
||||||
|
set -g status-style 'bg=${base00} fg=${base06}'
|
||||||
|
set -g status-left '#[fg=${base06} bg=${base01}] #S@#h '
|
||||||
|
set -g status-right '#[fg=${base07},bg=${base01}] %F #[fg=${base07},bg=${base02}] %H:%M:%S %Z '
|
||||||
|
set -g status-right-length 50
|
||||||
|
set -g status-left-length 20
|
||||||
|
|
||||||
|
setw -g window-status-current-style 'fg=${base07} bg=${base0D} bold'
|
||||||
|
setw -g window-status-current-format ' #I#[fg=${base07}]:#[fg=${base07}]#W#[fg=${base07}]#F '
|
||||||
|
|
||||||
|
setw -g window-status-style 'fg=${base06} bg=${base03}'
|
||||||
|
setw -g window-status-format ' #I#[fg=${base07}]:#[fg=${base06}]#W#[${base06}]#F '
|
||||||
|
|
||||||
|
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
|
||||||
|
|
||||||
|
# messages
|
||||||
|
set -g message-style 'fg=colour232 bg=colour16 bold'
|
||||||
|
|
||||||
|
# mouse
|
||||||
|
set -g mouse on
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
16
home/shell/z.nix
Normal file
16
home/shell/z.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
# ensure .local/share/z is created
|
||||||
|
xdg.dataFile."z/.keep".text = "";
|
||||||
|
|
||||||
|
programs.zsh = {
|
||||||
|
localVariables = {
|
||||||
|
_Z_DATA = "${config.xdg.dataHome}/z/data";
|
||||||
|
};
|
||||||
|
plugins = map (plugin: (with pkgs.${plugin}; {
|
||||||
|
name = pname;
|
||||||
|
inherit src;
|
||||||
|
})) [
|
||||||
|
"zsh-z"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
107
home/shell/zsh.nix
Normal file
107
home/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
|
||||||
|
zsh-completions
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec {
|
||||||
|
default = config.base16.defaultSchemeName;
|
||||||
|
current = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableSyntaxHighlighting = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
initExtra =
|
||||||
|
let
|
||||||
|
zshOpts = [
|
||||||
|
"auto_pushd"
|
||||||
|
"pushd_ignore_dups"
|
||||||
|
"pushdminus"
|
||||||
|
"rmstarsilent"
|
||||||
|
"nonomatch"
|
||||||
|
"long_list_jobs"
|
||||||
|
"interactivecomments"
|
||||||
|
"append_history"
|
||||||
|
"hist_ignore_space"
|
||||||
|
"hist_verify"
|
||||||
|
"inc_append_history"
|
||||||
|
"nosharehistory"
|
||||||
|
"nomenu_complete"
|
||||||
|
"auto_menu"
|
||||||
|
"no_auto_remove_slash"
|
||||||
|
"complete_in_word"
|
||||||
|
"always_to_end"
|
||||||
|
"nolistbeep"
|
||||||
|
"autolist"
|
||||||
|
"listrowsfirst"
|
||||||
|
]; in
|
||||||
|
''
|
||||||
|
${if pkgs.hostPlatform.isLinux then ''
|
||||||
|
eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90")
|
||||||
|
'' else ''
|
||||||
|
''}
|
||||||
|
PROMPT_EOL_MARK='''
|
||||||
|
ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm'
|
||||||
|
ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true
|
||||||
|
zmodload -i zsh/complist
|
||||||
|
h=()
|
||||||
|
if [[ -r ~/.ssh/config ]]; then
|
||||||
|
h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
||||||
|
fi
|
||||||
|
if [[ $#h -gt 0 ]]; then
|
||||||
|
zstyle ':completion:*:ssh:*' hosts $h
|
||||||
|
zstyle ':completion:*:slogin:*' hosts $h
|
||||||
|
fi
|
||||||
|
unset h
|
||||||
|
u=(root ${config.home.username})
|
||||||
|
zstyle ':completion:*:ssh:*' users $u
|
||||||
|
unset u
|
||||||
|
zstyle ':completion:*:*:*:*:*' menu select
|
||||||
|
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||||
|
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||||
|
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
||||||
|
zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*'
|
||||||
|
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
|
||||||
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath'
|
||||||
|
${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
|
||||||
|
bindkey '^ ' autosuggest-accept
|
||||||
|
${if pkgs.hostPlatform.isDarwin then ''
|
||||||
|
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||||
|
'' else ""
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
shellAliases = lib.mkMerge [
|
||||||
|
{
|
||||||
|
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||||
|
dmesg = "dmesg -HP";
|
||||||
|
hg = "history 0 | rg";
|
||||||
|
}
|
||||||
|
(lib.mkIf pkgs.hostPlatform.isLinux {
|
||||||
|
sys = "systemctl";
|
||||||
|
sysu = "systemctl --user";
|
||||||
|
logu = "journalctl --user";
|
||||||
|
log = "journalctl";
|
||||||
|
lg = "log --no-pager | rg";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
localVariables = {
|
||||||
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold";
|
||||||
|
ZSH_AUTOSUGGEST_USE_ASYNC = 1;
|
||||||
|
};
|
||||||
|
plugins = with pkgs.zsh-plugins; (map (plugin: plugin.zshPlugin) [
|
||||||
|
tab-title
|
||||||
|
vim-mode
|
||||||
|
evil-registers
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
XDG_DATA_HOME = "${config.xdg.dataHome}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
{ config, tree, machine, ... }: {
|
{
|
||||||
|
config,
|
||||||
|
tree,
|
||||||
|
machine,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
sharedModules = [
|
sharedModules = with tree; [
|
||||||
tree.home.modules
|
home.modules
|
||||||
tree.system.modules
|
home.common
|
||||||
];
|
];
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit tree machine;
|
inherit tree machine;
|
||||||
89
home/vim/default.nix
Normal file
89
home/vim/default.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
{ config, lib, pkgs, nixos, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.strings) concatStringsSep fixedWidthNumber hasInfix;
|
||||||
|
inherit (lib.attrsets) mapAttrs filterAttrs;
|
||||||
|
packDir = builtins.toString(pkgs.vimUtils.packDir config.programs.neovim.generatedConfigViml.configure.packages);
|
||||||
|
initLua = pkgs.substituteAll ({
|
||||||
|
name = "init.lua";
|
||||||
|
src = ./init.lua;
|
||||||
|
inherit packDir;
|
||||||
|
base16ShellPath = config.base16.shell.package;
|
||||||
|
inherit (config.base16) defaultSchemeName;
|
||||||
|
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
||||||
|
} // mapAttrs (_: col: fixedWidthNumber 2 col.ansiIndex)
|
||||||
|
(filterAttrs (var: _: hasInfix "base" var) config.base16.defaultScheme));
|
||||||
|
in {
|
||||||
|
home.sessionVariables = mkIf config.programs.neovim.enable { EDITOR = "nvim"; };
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
vimAlias = true;
|
||||||
|
viAlias = true;
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
# Libraries
|
||||||
|
plenary-nvim
|
||||||
|
# Disables and re-enables highlighting when searching
|
||||||
|
vim-cool
|
||||||
|
# Colour highlighting
|
||||||
|
vim-hexokinase
|
||||||
|
# Git porcelain
|
||||||
|
vim-fugitive
|
||||||
|
# Start screen
|
||||||
|
vim-startify
|
||||||
|
# Re-open with cursor at the same place
|
||||||
|
vim-lastplace
|
||||||
|
# Status Bar
|
||||||
|
lualine-nvim
|
||||||
|
# EasyMotion Equivalent
|
||||||
|
hop-nvim
|
||||||
|
# org-mode for vim
|
||||||
|
# neorg
|
||||||
|
# base16
|
||||||
|
config.base16.vim.plugin
|
||||||
|
# Fonts
|
||||||
|
nvim-web-devicons
|
||||||
|
# Completion
|
||||||
|
nvim-cmp
|
||||||
|
# Fuzzy Finder
|
||||||
|
telescope-nvim
|
||||||
|
# Buffers
|
||||||
|
bufferline-nvim
|
||||||
|
# Language Server
|
||||||
|
nvim-lspconfig
|
||||||
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: with pkgs.tree-sitter-grammars; [
|
||||||
|
tree-sitter-c
|
||||||
|
tree-sitter-lua
|
||||||
|
tree-sitter-rust
|
||||||
|
#tree-sitter-bash
|
||||||
|
tree-sitter-css
|
||||||
|
tree-sitter-dockerfile
|
||||||
|
tree-sitter-go
|
||||||
|
tree-sitter-hcl
|
||||||
|
tree-sitter-html
|
||||||
|
tree-sitter-javascript
|
||||||
|
tree-sitter-markdown
|
||||||
|
tree-sitter-nix
|
||||||
|
tree-sitter-norg
|
||||||
|
tree-sitter-python
|
||||||
|
tree-sitter-regex
|
||||||
|
tree-sitter-scss
|
||||||
|
]))
|
||||||
|
# Treesitter Plugins
|
||||||
|
nvim-ts-rainbow
|
||||||
|
nvim-treesitter-context
|
||||||
|
twilight-nvim
|
||||||
|
];
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
# For nvim-lspconfig, Terraform Language Server
|
||||||
|
terraform-ls
|
||||||
|
# For tree-sitter
|
||||||
|
tree-sitter
|
||||||
|
nodejs
|
||||||
|
clang
|
||||||
|
clangStdenv.cc
|
||||||
|
];
|
||||||
|
};
|
||||||
|
xdg.configFile."nvim/init.lua".source = initLua;
|
||||||
|
}
|
||||||
345
home/vim/init.lua
Normal file
345
home/vim/init.lua
Normal file
|
|
@ -0,0 +1,345 @@
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Variables
|
||||||
|
-----------------------------------------------------------
|
||||||
|
local g = vim.g -- Global variables
|
||||||
|
local opt = vim.opt -- Set options (global/buffer/windows-scoped)
|
||||||
|
local wo = vim.wo -- Window local variables
|
||||||
|
local api = vim.api -- Lua API
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Nix Fuckery
|
||||||
|
-----------------------------------------------------------
|
||||||
|
opt.packpath:prepend{"@packDir@"}
|
||||||
|
opt.runtimepath:prepend{"@packDir@"}
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Base16
|
||||||
|
-----------------------------------------------------------
|
||||||
|
vim.g.base16colorspace = 256
|
||||||
|
vim.g.base16background = "@defaultSchemeName@"
|
||||||
|
g.base16_shell_path = "@base16ShellPath@"
|
||||||
|
vim.cmd("colorscheme base16-@defaultSchemeSlug@")
|
||||||
|
g.colors_name = "@defaultSchemeSlug@"
|
||||||
|
|
||||||
|
local base16 = {
|
||||||
|
base00 = "@base00@",
|
||||||
|
base01 = "@base01@",
|
||||||
|
base02 = "@base02@",
|
||||||
|
base03 = "@base03@",
|
||||||
|
base04 = "@base04@",
|
||||||
|
base05 = "@base05@",
|
||||||
|
base06 = "@base06@",
|
||||||
|
base07 = "@base07@",
|
||||||
|
base08 = "@base08@",
|
||||||
|
base09 = "@base09@",
|
||||||
|
base0A = "@base0A@",
|
||||||
|
base0B = "@base0B@",
|
||||||
|
base0C = "@base0C@",
|
||||||
|
base0D = "@base0D@",
|
||||||
|
base0E = "@base0E@",
|
||||||
|
base0F = "@base0F@"
|
||||||
|
}
|
||||||
|
|
||||||
|
api.nvim_create_autocmd("vimenter", {
|
||||||
|
command = "highlight Normal guibg=NONE ctermbg=NONE"
|
||||||
|
})
|
||||||
|
api.nvim_create_autocmd("SourcePost", {
|
||||||
|
command = "highlight Normal ctermbg=NONE guibg=NONE | " ..
|
||||||
|
"highlight LineNr ctermbg=NONE guibg=NONE | " ..
|
||||||
|
"highlight SignColumn ctermbg=NONE guibg=NONE"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- General
|
||||||
|
-----------------------------------------------------------
|
||||||
|
opt.mouse = 'a' -- Enable mouse support
|
||||||
|
opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard
|
||||||
|
opt.completeopt = 'longest,menuone' -- Autocomplete options
|
||||||
|
opt.backup = false -- Disable backup
|
||||||
|
opt.writebackup = false -- Disable backup
|
||||||
|
opt.ttimeoutlen = 100 -- Mapping timeout
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Neovim UI
|
||||||
|
-----------------------------------------------------------
|
||||||
|
opt.number = true -- Show line number
|
||||||
|
opt.relativenumber = true -- Relative line numbers
|
||||||
|
opt.showmatch = true -- Highlight matching parenthesis
|
||||||
|
opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker')
|
||||||
|
opt.colorcolumn = '80' -- Line length marker at 80 columns
|
||||||
|
opt.splitright = true -- Vertical split to the right
|
||||||
|
opt.splitbelow = true -- Horizontal split to the bottom
|
||||||
|
opt.ignorecase = true -- Ignore case letters when search
|
||||||
|
opt.smartcase = true -- Ignore lowercase for the whole pattern
|
||||||
|
opt.wrap = true -- Wrap on word boundary
|
||||||
|
opt.linebreak = true -- Wrap on word boundary
|
||||||
|
opt.showbreak = " ↳" -- Character to use to display word boundary
|
||||||
|
opt.termguicolors = false -- Enable 24-bit RGB colors
|
||||||
|
opt.laststatus = 3 -- Set global statusline
|
||||||
|
opt.cursorline = true -- Highlight cursor screenline
|
||||||
|
opt.cmdheight = 1 -- Command entry line height
|
||||||
|
opt.hlsearch = true -- Highlight matches with last search pattern
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Tabs, indent
|
||||||
|
-----------------------------------------------------------
|
||||||
|
opt.expandtab = true -- Use spaces instead of tabs
|
||||||
|
opt.shiftwidth = 2 -- Shift 2 spaces when tab
|
||||||
|
opt.tabstop = 2 -- 1 tab == 2 spaces
|
||||||
|
opt.smartindent = true -- Autoindent new lines
|
||||||
|
opt.list = true -- List chars
|
||||||
|
opt.listchars = {
|
||||||
|
tab = '» ',
|
||||||
|
extends = '›',
|
||||||
|
precedes= '‹',
|
||||||
|
nbsp = '·',
|
||||||
|
trail = '✖'
|
||||||
|
}
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Memory, CPU
|
||||||
|
-----------------------------------------------------------
|
||||||
|
opt.hidden = true -- Enable background buffers
|
||||||
|
opt.history = 100 -- Remember N lines in history
|
||||||
|
opt.lazyredraw = true -- Faster scrolling
|
||||||
|
opt.synmaxcol = 240 -- Max column for syntax highlight
|
||||||
|
opt.updatetime = 700 -- ms to wait for trigger an event
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Plugins
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
-- Remove perl
|
||||||
|
g.loaded_perl_provider = 0
|
||||||
|
|
||||||
|
-- Hexokinaise
|
||||||
|
g.Hexokinase_highlighters = {'virtual'}
|
||||||
|
g.Hexokinase_optInPatterns = {
|
||||||
|
'full_hex',
|
||||||
|
'rgb',
|
||||||
|
'rgba',
|
||||||
|
'hsl',
|
||||||
|
'hsla',
|
||||||
|
'colour_names'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Lastplace
|
||||||
|
g.lastplace_ignore = 'gitcommit,gitrebase,svn,hgcommit'
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Startup
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
-- Disable builtins plugins
|
||||||
|
local disabled_built_ins = {
|
||||||
|
"netrw",
|
||||||
|
"netrwPlugin",
|
||||||
|
"netrwSettings",
|
||||||
|
"netrwFileHandlers",
|
||||||
|
"gzip",
|
||||||
|
"zip",
|
||||||
|
"zipPlugin",
|
||||||
|
"tar",
|
||||||
|
"tarPlugin",
|
||||||
|
"getscript",
|
||||||
|
"getscriptPlugin",
|
||||||
|
"vimball",
|
||||||
|
"vimballPlugin",
|
||||||
|
"2html_plugin",
|
||||||
|
"logipat",
|
||||||
|
"rrhelper",
|
||||||
|
"spellfile_plugin",
|
||||||
|
"matchit"
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, plugin in pairs(disabled_built_ins) do
|
||||||
|
g["loaded_" .. plugin] = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
-- Plugins
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
-- lualine
|
||||||
|
require('lualine').setup{}
|
||||||
|
|
||||||
|
-- nvim-cmp
|
||||||
|
local cmp = require('cmp')
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
-- { name = 'neorg' },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- lspconfig
|
||||||
|
require('lspconfig').terraformls.setup{}
|
||||||
|
|
||||||
|
api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
pattern = '*.tf',
|
||||||
|
command = 'lua vim.lsp.buf.formatting_sync()'
|
||||||
|
})
|
||||||
|
|
||||||
|
--[[
|
||||||
|
-- neorg
|
||||||
|
require('neorg').setup {
|
||||||
|
-- Tell Neorg what modules to load
|
||||||
|
load = {
|
||||||
|
['core.defaults'] = {}, -- Load all the default modules
|
||||||
|
['core.norg.concealer'] = {}, -- Allows for use of icons
|
||||||
|
['core.norg.dirman'] = { -- Manage your directories with Neorg
|
||||||
|
config = {
|
||||||
|
engine = 'nvim-cmp',
|
||||||
|
workspaces = {
|
||||||
|
home = '~/neorg'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}]]--
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
local telescope = require('telescope.builtin')
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>ff", function()
|
||||||
|
telescope.find_files()
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>fg", function()
|
||||||
|
telescope.live_grep()
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>fb", function()
|
||||||
|
telescope.buffers()
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>fh", function()
|
||||||
|
telescope.help_tags()
|
||||||
|
end, { silent = true })
|
||||||
|
|
||||||
|
-- treesitter
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
-- A list of parser names, or "all"
|
||||||
|
ensure_installed = {
|
||||||
|
},
|
||||||
|
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = false,
|
||||||
|
ignore_install = {},
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
rainbow = {
|
||||||
|
enable = true,
|
||||||
|
extended_mode = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- twilight
|
||||||
|
require("twilight").setup {
|
||||||
|
dimming = {
|
||||||
|
alpha = 0.5,
|
||||||
|
},
|
||||||
|
context = 10,
|
||||||
|
expand = {
|
||||||
|
"function",
|
||||||
|
"method",
|
||||||
|
"table",
|
||||||
|
"if_statement",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- bufferline
|
||||||
|
require('bufferline').setup {
|
||||||
|
options = {
|
||||||
|
mode = "buffers", -- set to "tabs" to only show tabpages instead
|
||||||
|
numbers = "ordinal",
|
||||||
|
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||||
|
indicator = {
|
||||||
|
icon = '▎',
|
||||||
|
style = 'icon',
|
||||||
|
},
|
||||||
|
buffer_close_icon = '',
|
||||||
|
modified_icon = '●',
|
||||||
|
close_icon = '',
|
||||||
|
left_trunc_marker = '',
|
||||||
|
right_trunc_marker = '',
|
||||||
|
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||||
|
-- remove extension from markdown files for example
|
||||||
|
if buf.name:match('%.md') then
|
||||||
|
return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
max_name_length = 18,
|
||||||
|
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||||
|
tab_size = 18,
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
diagnostics_update_in_insert = false,
|
||||||
|
color_icons = true,
|
||||||
|
show_buffer_icons = true, -- disable filetype icons for buffers
|
||||||
|
show_buffer_close_icons = true,
|
||||||
|
show_close_icon = false,
|
||||||
|
show_tab_indicators = true,
|
||||||
|
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||||
|
separator_style = "slant",
|
||||||
|
always_show_bufferline = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local barColor = base16.base00;
|
||||||
|
|
||||||
|
local highlightItems = {
|
||||||
|
BufferLineFill = "bg",
|
||||||
|
BufferLineBackground = "bg",
|
||||||
|
BufferLineSeparator = "fg",
|
||||||
|
BufferLineSeparatorSelected = "fg",
|
||||||
|
BufferLineSeparatorVisible = "fg",
|
||||||
|
}
|
||||||
|
|
||||||
|
local commandString = ""
|
||||||
|
|
||||||
|
for item, ground in pairs(highlightItems) do
|
||||||
|
commandString = "highlight " .. item .. " cterm" .. ground .. "=" .. barColor .. " | " .. commandString
|
||||||
|
end
|
||||||
|
|
||||||
|
api.nvim_create_autocmd("ColorScheme", {
|
||||||
|
command = commandString;
|
||||||
|
})
|
||||||
|
|
||||||
|
-- hop
|
||||||
|
local hop = require('hop')
|
||||||
|
local directions = require("hop.hint").HintDirection
|
||||||
|
hop.setup()
|
||||||
|
|
||||||
|
vim.keymap.set("", "t", function()
|
||||||
|
hop.hint_words()
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
vim.keymap.set("", "T", function()
|
||||||
|
hop.hint_lines_skip_whitespace()
|
||||||
|
end, {remap=true})
|
||||||
|
|
||||||
|
vim.keymap.set("", "f", function()
|
||||||
|
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||||
|
end, {remap=true})
|
||||||
|
|
||||||
|
vim.keymap.set("", "F", function()
|
||||||
|
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||||
|
end, {remap=true})
|
||||||
10
home/wezterm.nix
Normal file
10
home/wezterm.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
_: {
|
||||||
|
programs.wezterm.enable = true;
|
||||||
|
xdg.configFile."wezterm/wezterm.lua".text = ''
|
||||||
|
local = wezterm = require 'wezterm'
|
||||||
|
return {
|
||||||
|
check_for_updates = false,
|
||||||
|
enable_tab_bar = true
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -7,4 +7,5 @@ let
|
||||||
kittywitch = import flakeCompat {
|
kittywitch = import flakeCompat {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
};
|
};
|
||||||
in kittywitch.defaultNix.inputs
|
in
|
||||||
|
kittywitch.defaultNix.inputs
|
||||||
|
|
|
||||||
20
nixos/gnome.nix
Normal file
20
nixos/gnome.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
desktopManager.gnome.enable = true;
|
||||||
|
displayManager.gdm.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs.gnomeExtensions; [
|
||||||
|
dash-to-dock
|
||||||
|
gsconnect
|
||||||
|
appindicator
|
||||||
|
];
|
||||||
|
|
||||||
|
services.udev.packages = with pkgs.gnome; [
|
||||||
|
gnome-settings-daemon
|
||||||
|
];
|
||||||
|
}
|
||||||
9
nixos/laptop.nix
Normal file
9
nixos/laptop.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkDefault;
|
||||||
|
in {
|
||||||
|
powerManagement.cpuFreqGovernor = mkDefault "powersave";
|
||||||
|
programs.light.enable = true;
|
||||||
|
}
|
||||||
1
nixos/modules/blank.nix
Normal file
1
nixos/modules/blank.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
_: {}
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
in {
|
|
||||||
config = mkIf config.role.gnome {
|
|
||||||
services.xserver = {
|
|
||||||
enable = true;
|
|
||||||
desktopManager.gnome.enable = true;
|
|
||||||
displayManager.gdm.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs.gnomeExtensions; [
|
|
||||||
dash-to-dock
|
|
||||||
gsconnect
|
|
||||||
appindicator
|
|
||||||
];
|
|
||||||
|
|
||||||
services.udev.packages = with pkgs.gnome; [
|
|
||||||
gnome-settings-daemon
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{ config, lib, ... }: let
|
|
||||||
inherit (lib.modules) mkIf mkDefault;
|
|
||||||
in {
|
|
||||||
config = mkIf config.role.laptop {
|
|
||||||
powerManagement.cpuFreqGovernor = mkDefault "powersave";
|
|
||||||
programs.light.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
{ config, lib, ... }: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
in {
|
|
||||||
config = mkIf config.role.personal {
|
|
||||||
services.fstrim.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{ config, lib, ... }: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
|
||||||
in {
|
|
||||||
config = mkIf config.role.server {
|
|
||||||
# Prevent services from being automatically killed on log-out
|
|
||||||
# https://wiki.archlinux.org/title/systemd/User#Automatic_start-up_of_systemd_user_instances
|
|
||||||
systemd.tmpfiles.rules = mapAttrsToList (username: _: "f /var/lib/systemd/linger/${username}" ) config.users.users;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
3
nixos/personal.nix
Normal file
3
nixos/personal.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
_: {
|
||||||
|
services.fstrim.enable = true;
|
||||||
|
}
|
||||||
8
nixos/server.nix
Normal file
8
nixos/server.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
in {
|
||||||
|
systemd.tmpfiles.rules = mapAttrsToList (username: _: "f /var/lib/systemd/linger/${username}") config.users.users;
|
||||||
|
}
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
role = {
|
|
||||||
laptop = true;
|
|
||||||
personal = true;
|
|
||||||
gnome = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems = {
|
|
||||||
"/" = {
|
|
||||||
device = "/dev/disk/by-uuid/a664de0f-9883-420e-acc5-b9602a23e816";
|
|
||||||
fsType = "xfs";
|
|
||||||
};
|
|
||||||
"/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/DEBC-8F03";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/disk/by-uuid/0d846453-95b4-46e1-8eaf-b910b4321ef0"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
supportedFilesystems = [ "xfs" ];
|
|
||||||
initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/f0ea08b4-6af7-4d90-a2ad-edd5672a2105";
|
|
||||||
loader = {
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
efiSysMountPoint = "/boot";
|
|
||||||
};
|
|
||||||
grub = {
|
|
||||||
devices = [ "nodev" ];
|
|
||||||
efiSupport = true;
|
|
||||||
enable = true;
|
|
||||||
extraEntries = ''
|
|
||||||
menuentry "Windows" {
|
|
||||||
insmod part_gpt
|
|
||||||
insmod fat
|
|
||||||
insmod search_fs_uuid
|
|
||||||
insmod chain
|
|
||||||
search --fs-uuid --set=root DEBC-8F03
|
|
||||||
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
version = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "21.11";
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ tree, config, ... }: {
|
_: {
|
||||||
users.users.kat = {
|
users.users.kat = {
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
|
|
||||||
268
outputs.nix
268
outputs.nix
|
|
@ -1,5 +1,16 @@
|
||||||
{ self, utils, nixpkgs, darwin, home-manager, ragenix, scalpel, mach-nix, arcexprs, ... }@inputs: let
|
{
|
||||||
tree = (inputs.tree.tree {
|
utils,
|
||||||
|
nixpkgs,
|
||||||
|
darwin,
|
||||||
|
home-manager,
|
||||||
|
ragenix,
|
||||||
|
scalpel,
|
||||||
|
nix-index-database,
|
||||||
|
arcexprs,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
|
tree =
|
||||||
|
(inputs.tree.tree {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
folder = ./.;
|
folder = ./.;
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -9,6 +20,15 @@
|
||||||
"default"
|
"default"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
"darwin/modules" = {
|
||||||
|
functor = {
|
||||||
|
enable = true;
|
||||||
|
external = [
|
||||||
|
home-manager.darwinModules.home-manager
|
||||||
|
ragenix.nixosModules.age
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
"system/modules" = {
|
"system/modules" = {
|
||||||
functor = {
|
functor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -17,122 +37,158 @@
|
||||||
"nixos/modules" = {
|
"nixos/modules" = {
|
||||||
functor = {
|
functor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
external = with (import (arcexprs + "/modules")).nixos; [
|
external =
|
||||||
|
[
|
||||||
|
nix-index-database.nixosModules.nix-index
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
ragenix.nixosModules.age
|
||||||
|
]
|
||||||
|
++ (with (import (arcexprs + "/modules")).nixos; [
|
||||||
base16
|
base16
|
||||||
base16-shared
|
base16-shared
|
||||||
];
|
]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"home/modules" = {
|
"home/modules" = {
|
||||||
functor = {
|
functor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
external = with (import (arcexprs + "/modules")).home-manager; [
|
external =
|
||||||
|
[
|
||||||
|
nix-index-database.hmModules.nix-index
|
||||||
|
]
|
||||||
|
++ (with (import (arcexprs + "/modules")).home-manager; [
|
||||||
base16
|
base16
|
||||||
base16-shared
|
base16-shared
|
||||||
];
|
]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}).impure;
|
|
||||||
lib = inputs.nixpkgs.lib;
|
|
||||||
inherit (lib.lists) fold;
|
|
||||||
inherit (lib.attrsets) mapAttrs recursiveUpdate;
|
|
||||||
recursiveMergeAttrs = listOfAttrsets: fold (attrset: acc: recursiveUpdate attrset acc) {} listOfAttrsets;
|
|
||||||
in recursiveMergeAttrs [
|
|
||||||
(utils.lib.mkFlake {
|
|
||||||
inherit self inputs;
|
|
||||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
|
|
||||||
channelsConfig.allowUnfree = true;
|
|
||||||
|
|
||||||
hostDefaults = {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
tree.system.modules
|
|
||||||
];
|
|
||||||
extraArgs = {
|
|
||||||
inherit inputs tree;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hosts = let
|
|
||||||
outputForSystem = system: {
|
|
||||||
"x86_64-linux" = "nixosConfigurations";
|
|
||||||
"aarch64-darwin" = "darwinConfigurations";
|
|
||||||
}.${system};
|
|
||||||
builderForSystem = system: {
|
|
||||||
"x86_64-linux" = nixpkgs.lib.nixosSystem;
|
|
||||||
"aarch64-darwin" = darwin.lib.darwinSystem;
|
|
||||||
}.${system};
|
|
||||||
modulesForSystem = system: {
|
|
||||||
"x86_64-linux" = [
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
ragenix.nixosModules.age
|
|
||||||
tree.nixos.modules
|
|
||||||
];
|
|
||||||
"aarch64-darwin" = [
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
ragenix.nixosModules.age
|
|
||||||
tree.darwin.modules
|
|
||||||
];
|
|
||||||
}.${system};
|
|
||||||
mapSystem = system: name: path: {
|
|
||||||
inherit system;
|
|
||||||
output = outputForSystem system;
|
|
||||||
builder = builderForSystem system;
|
|
||||||
modules = (modulesForSystem system) ++ [
|
|
||||||
path
|
|
||||||
];
|
|
||||||
extraArgs = {
|
|
||||||
machine = name;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in mapAttrs (mapSystem "x86_64-linux") tree.nixos.systems
|
|
||||||
// mapAttrs (mapSystem "aarch64-darwin") tree.darwin.systems;
|
|
||||||
|
|
||||||
outputsBuilder = channels: {
|
|
||||||
nixosConfigurations = mapAttrs(_: sys: sys.extendModules {
|
|
||||||
modules = [ scalpel.nixosModule ];
|
|
||||||
specialArgs = {
|
|
||||||
prev = sys;
|
|
||||||
};
|
|
||||||
}) self.nixosConfigurations;
|
|
||||||
|
|
||||||
homeManagerConfigurations = mapAttrs (name: path: home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs = channels.nixpkgs;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit channels inputs tree;
|
|
||||||
machine = name;
|
|
||||||
nixos = {};
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
tree.system.modules
|
|
||||||
tree.home.common
|
|
||||||
path
|
|
||||||
];
|
|
||||||
}) tree.home.profiles;
|
|
||||||
|
|
||||||
devShells = {
|
|
||||||
rust = with channels.nixpkgs; mkShell {
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cargo
|
|
||||||
rustc
|
|
||||||
rustfmt
|
|
||||||
rustPackages.clippy
|
|
||||||
rust-analyzer
|
|
||||||
];
|
|
||||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
inherit tree;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
(utils.lib.eachDefaultSystem (system: {
|
.impure;
|
||||||
devShells.python = nixpkgs.legacyPackages."${system}".mkShell {
|
inherit (inputs.nixpkgs) lib;
|
||||||
buildInputs = let
|
inherit (lib.lists) fold;
|
||||||
pythonWithPkgs = mach-nix.lib."${system}".mkPython {
|
inherit (lib.attrsets) mapAttrs mapAttrsToList recursiveUpdate;
|
||||||
ignoreDataOutdated = true;
|
inherit (lib.strings) toLower;
|
||||||
python = "python310";
|
inherit (lib.options) mkOption;
|
||||||
}; in [ pythonWithPkgs ];
|
inherit (lib.types) str listOf attrs unspecified;
|
||||||
|
inherit (lib.modules) evalModules;
|
||||||
|
recursiveMergeAttrs = fold recursiveUpdate {};
|
||||||
|
defaultSpecialArgs = {
|
||||||
|
inherit inputs tree;
|
||||||
};
|
};
|
||||||
|
hostModule = {
|
||||||
|
config,
|
||||||
|
machine,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options = {
|
||||||
|
arch = mkOption {
|
||||||
|
description = "Processor architecture of the host";
|
||||||
|
type = str;
|
||||||
|
default = "x86_64";
|
||||||
|
};
|
||||||
|
type = mkOption {
|
||||||
|
description = "Operating system type of the host";
|
||||||
|
type = str;
|
||||||
|
default = "NixOS";
|
||||||
|
};
|
||||||
|
folder = mkOption {
|
||||||
|
type = str;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
system = mkOption {
|
||||||
|
type = str;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
modules = mkOption {
|
||||||
|
type = listOf unspecified;
|
||||||
|
};
|
||||||
|
specialArgs = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
builder = mkOption {
|
||||||
|
type = unspecified;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
system = let
|
||||||
|
kernel =
|
||||||
|
{
|
||||||
|
nixos = "linux";
|
||||||
|
macos = "darwin";
|
||||||
|
darwin = "darwin";
|
||||||
|
linux = "linux";
|
||||||
|
}
|
||||||
|
.${toLower config.type};
|
||||||
|
in "${config.arch}-${kernel}";
|
||||||
|
folder =
|
||||||
|
{
|
||||||
|
nixos = "nixos";
|
||||||
|
macos = "darwin";
|
||||||
|
darwin = "darwin";
|
||||||
|
linux = "linux";
|
||||||
|
}
|
||||||
|
.${toLower config.type};
|
||||||
|
modules = with tree; [
|
||||||
|
tree.${config.folder}.modules
|
||||||
|
home.system
|
||||||
|
];
|
||||||
|
builder =
|
||||||
|
{
|
||||||
|
nixos = nixpkgs.lib.nixosSystem;
|
||||||
|
darwin = darwin.lib.darwinSystem;
|
||||||
|
macos = darwin.lib.darwinSystem;
|
||||||
|
}
|
||||||
|
.${toLower config.type};
|
||||||
|
specialArgs = {inherit machine;} // defaultSpecialArgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
hostConfigs = mapAttrs (name: path:
|
||||||
|
evalModules {
|
||||||
|
modules = [
|
||||||
|
hostModule
|
||||||
|
path
|
||||||
|
];
|
||||||
|
specialArgs =
|
||||||
|
{
|
||||||
|
machine = name;
|
||||||
|
}
|
||||||
|
// defaultSpecialArgs;
|
||||||
|
})
|
||||||
|
tree.systems;
|
||||||
|
processHost = name: cfg: let
|
||||||
|
host = cfg.config;
|
||||||
|
in {
|
||||||
|
"${host.folder}Configurations".${name} = let
|
||||||
|
hostConfig = host.builder {
|
||||||
|
inherit (host) system modules specialArgs;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
if host.folder == "nixos"
|
||||||
|
then
|
||||||
|
hostConfig.extendModules {
|
||||||
|
modules = [scalpel.nixosModule];
|
||||||
|
specialArgs = {
|
||||||
|
prev = hostConfig;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else hostConfig;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
recursiveMergeAttrs (mapAttrsToList processHost hostConfigs)
|
||||||
|
// {
|
||||||
|
inherit inputs tree hostConfigs;
|
||||||
|
}
|
||||||
|
// (utils.lib.eachDefaultSystem (system: {
|
||||||
|
devShells = let
|
||||||
|
shells = mapAttrs (_: path:
|
||||||
|
import path rec {
|
||||||
|
inherit tree inputs system;
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
inherit (nixpkgs) lib;
|
||||||
|
})
|
||||||
|
tree.shells;
|
||||||
|
in shells // { default = shells.repo; };
|
||||||
}))
|
}))
|
||||||
]
|
|
||||||
|
|
|
||||||
9
shells/nix.nix
Normal file
9
shells/nix.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
with pkgs;
|
||||||
|
mkShell {
|
||||||
|
nativeBuildInputs = [
|
||||||
|
deadnix # dead-code scanner
|
||||||
|
alejandra # code formatter
|
||||||
|
statix # anti-pattern finder
|
||||||
|
];
|
||||||
|
}
|
||||||
15
shells/repo.nix
Normal file
15
shells/repo.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{pkgs, inputs, system, ...}: with pkgs; let
|
||||||
|
repo = import ../outputs.nix (inputs // { inherit inputs system; });
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
in
|
||||||
|
mkShell {
|
||||||
|
nativeBuildInputs = [
|
||||||
|
deadnix # dead-code scanner
|
||||||
|
alejandra # code formatter
|
||||||
|
statix # anti-pattern finder
|
||||||
|
] ++ mapAttrsToList (name: _:
|
||||||
|
(pkgs.writeShellScriptBin "${name}-rebuild" ''
|
||||||
|
darwin-rebuild switch --flake ${toString ../.}#${name}
|
||||||
|
''))
|
||||||
|
repo.darwinConfigurations;
|
||||||
|
}
|
||||||
12
shells/rust.nix
Normal file
12
shells/rust.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
with pkgs;
|
||||||
|
mkShell {
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
rustfmt
|
||||||
|
rustPackages.clippy
|
||||||
|
rust-analyzer
|
||||||
|
];
|
||||||
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||||
|
}
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
{ config, lib, ... }: let
|
|
||||||
inherit (lib.options) mkOption mdDoc;
|
|
||||||
inherit (lib.types) bool;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
role = {
|
|
||||||
server = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = mdDoc "Is this system's role as a server?";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
personal = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = mdDoc "Is this system's role as a personal device?";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
development = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = mdDoc "Is this system's role as a development device?";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
laptop = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = mdDoc "Is this system's role as a laptop?";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
gnome = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = mdDoc "Does this system's role include running GNOME?";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
60
systems/koishi.nix
Normal file
60
systems/koishi.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
_: let
|
||||||
|
hostConfig = {
|
||||||
|
tree,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = with tree; [
|
||||||
|
nixos.gnome
|
||||||
|
];
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/a664de0f-9883-420e-acc5-b9602a23e816";
|
||||||
|
fsType = "xfs";
|
||||||
|
};
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/DEBC-8F03";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{device = "/dev/disk/by-uuid/0d846453-95b4-46e1-8eaf-b910b4321ef0";}
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
supportedFilesystems = ["xfs"];
|
||||||
|
initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/f0ea08b4-6af7-4d90-a2ad-edd5672a2105";
|
||||||
|
loader = {
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
efiSysMountPoint = "/boot";
|
||||||
|
};
|
||||||
|
grub = {
|
||||||
|
devices = ["nodev"];
|
||||||
|
efiSupport = true;
|
||||||
|
enable = true;
|
||||||
|
extraEntries = ''
|
||||||
|
menuentry "Windows" {
|
||||||
|
insmod part_gpt
|
||||||
|
insmod fat
|
||||||
|
insmod search_fs_uuid
|
||||||
|
insmod chain
|
||||||
|
search --fs-uuid --set=root DEBC-8F03
|
||||||
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
version = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "21.11";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
arch = "x86_64";
|
||||||
|
type = "NixOS";
|
||||||
|
modules = [
|
||||||
|
hostConfig
|
||||||
|
];
|
||||||
|
}
|
||||||
11
systems/sumireko.nix
Normal file
11
systems/sumireko.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
_: let
|
||||||
|
hostConfig = _: {
|
||||||
|
system.stateVersion = 4;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
arch = "aarch64";
|
||||||
|
type = "macOS";
|
||||||
|
modules = [
|
||||||
|
hostConfig
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue