mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
Compatibility, bringing Sumireko into the fold. Deprecate katexprs.
This commit is contained in:
parent
efae399c70
commit
40edeef897
39 changed files with 879 additions and 175 deletions
31
config/hosts/sumireko.nix
Normal file
31
config/hosts/sumireko.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, pkgs, lib, meta, ... }: {
|
||||
imports = with meta; [
|
||||
profiles.darwin
|
||||
users.kat.darwin
|
||||
users.kat.dev
|
||||
];
|
||||
services.nix-daemon.enable = true;
|
||||
nix = {
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
package = pkgs.nixFlakes;
|
||||
};
|
||||
homebrew = {
|
||||
enable = true;
|
||||
brewPrefix = "/opt/homebrew/bin";
|
||||
casks = [
|
||||
"element"
|
||||
];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
awscli
|
||||
jq
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = 4;
|
||||
}
|
||||
54
config/modules/home/firewall.nix
Normal file
54
config/modules/home/firewall.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.network.firewall;
|
||||
in
|
||||
{
|
||||
options.network.firewall = {
|
||||
public.tcp.ports = mkOption {
|
||||
type = types.listOf types.port;
|
||||
default = [ ];
|
||||
};
|
||||
public.udp.ports = mkOption {
|
||||
type = types.listOf types.port;
|
||||
default = [ ];
|
||||
};
|
||||
private.tcp.ports = mkOption {
|
||||
type = types.listOf types.port;
|
||||
default = [ ];
|
||||
};
|
||||
private.udp.ports = mkOption {
|
||||
type = types.listOf types.port;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
public.tcp.ranges = mkOption {
|
||||
type = types.listOf (types.attrsOf types.port);
|
||||
default = [ ];
|
||||
};
|
||||
public.udp.ranges = mkOption {
|
||||
type = types.listOf (types.attrsOf types.port);
|
||||
default = [ ];
|
||||
};
|
||||
private.tcp.ranges = mkOption {
|
||||
type = types.listOf (types.attrsOf types.port);
|
||||
default = [ ];
|
||||
};
|
||||
private.udp.ranges = mkOption {
|
||||
type = types.listOf (types.attrsOf types.port);
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
public.interfaces = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "Public firewall interfaces";
|
||||
default = [ ];
|
||||
};
|
||||
private.interfaces = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "Private firewall interfaces";
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
81
config/modules/home/network.nix
Normal file
81
config/modules/home/network.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{ config, nixos, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.network = {
|
||||
enable = mkEnableOption "Use kat's network module?";
|
||||
addresses = mkOption {
|
||||
type = with types; attrsOf (submodule ({ name, ... }: {
|
||||
options = {
|
||||
enable = mkEnableOption "Is the system a part of the ${name} network?";
|
||||
ipv4 = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
};
|
||||
address = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
ipv6 = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
};
|
||||
address = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
prefix = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
out = {
|
||||
identifierList = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = if config.enable then singleton config.domain ++ config.out.addressList else [ ];
|
||||
};
|
||||
addressList = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = if config.enable then concatMap (i: optional i.enable i.address) [ config.ipv4 config.ipv6 ] else [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
privateGateway = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
tf = {
|
||||
enable = mkEnableOption "Was the system provisioned by terraform?";
|
||||
ipv4_attr = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
ipv6_attr = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
dns = {
|
||||
enable = mkEnableOption "Do you want DNS to be semi-managed through this module?";
|
||||
isRoot = mkEnableOption "Is this system supposed to be the @ for the domain?";
|
||||
email = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
zone = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
dynamic = mkEnableOption "Enable Glauca Dynamic DNS Updater";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
network.addresses = nixos.network.addresses or {};
|
||||
network.privateGateway = nixos.network.privateGateway or "";
|
||||
network.tf = nixos.network.tf or {};
|
||||
network.dns = nixos.network.dns or {};
|
||||
};
|
||||
}
|
||||
17
config/profiles/darwin/home.nix
Normal file
17
config/profiles/darwin/home.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ meta, config, inputs, tf, lib, ... }: with lib; {
|
||||
options.home-manager.users = mkOption {
|
||||
type = types.attrsOf (types.submoduleWith {
|
||||
modules = singleton meta.modules.home;
|
||||
specialArgs = {
|
||||
inherit inputs tf meta;
|
||||
nixos = config;
|
||||
};
|
||||
});
|
||||
};
|
||||
config = {
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
sd
|
||||
duc-cli
|
||||
bat
|
||||
exa-noman
|
||||
exa
|
||||
socat
|
||||
rsync
|
||||
wget
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ in
|
|||
yes = "me instead";
|
||||
};
|
||||
xdg.dataFile = { "z/.keep".text = ""; };
|
||||
home.packages = with pkgs; [ fzf fd zsh-completions akiflags ];
|
||||
home.packages = with pkgs; [ fzf fd zsh-completions ];
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableSyntaxHighlighting = true;
|
||||
|
|
@ -61,7 +61,10 @@ in
|
|||
HISTFILE=/persist/home/.zsh_history
|
||||
'' else ''
|
||||
''}
|
||||
${if pkgs.stdenv.system != "aarch64-darwin" then ''
|
||||
eval $(dircolors)
|
||||
'' else ''
|
||||
''}
|
||||
PROMPT_EOL_MARK='''
|
||||
ZSH_TAB_TITLE_ADDITIONAL_TERMS='foot'
|
||||
ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true
|
||||
|
|
@ -124,6 +127,9 @@ in
|
|||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
});
|
||||
};
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_HOME = "${config.xdg.dataHome}";
|
||||
};
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ set list listchars=tab:»\ ,extends:›,precedes:‹,nbsp:·,trail:✖
|
|||
" Enable mouse
|
||||
set mouse=a
|
||||
|
||||
set viminfo='100000,<100000,s1000,h,n$XDG_DATA_HOME/vim/viminfo'
|
||||
set viminfo='100000,<100000,s1000,h,n~/.local/share/vim/viminfo'
|
||||
set ts=2
|
||||
set sw=2
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
{ config, lib, pkgs, nixos, ... }: with lib;
|
||||
|
||||
let initvim = pkgs.callPackage
|
||||
({ stdenv, elinks, nodejs }: stdenv.mkDerivation {
|
||||
({ stdenv, nodejs }: stdenv.mkDerivation {
|
||||
name = "init.vim";
|
||||
src = ./init.vim;
|
||||
inherit nodejs elinks;
|
||||
inherit nodejs;
|
||||
buildInputs = [
|
||||
elinks
|
||||
nodejs
|
||||
];
|
||||
phases = [ "buildPhase" ];
|
||||
|
|
|
|||
14
config/users/kat/darwin.nix
Normal file
14
config/users/kat/darwin.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, ... }: {
|
||||
users.users.kat = {
|
||||
name = "kat";
|
||||
home = "/Users/kat";
|
||||
shell = pkgs.zsh;
|
||||
uid = 501;
|
||||
};
|
||||
users.knownUsers = [
|
||||
"kat"
|
||||
];
|
||||
home-manager.users.kat.programs.zsh.initExtraFirst = ''
|
||||
source /etc/static/zshrc
|
||||
'';
|
||||
}
|
||||
|
|
@ -10,9 +10,16 @@
|
|||
serviceImports = wrapImports tree.prev.services;
|
||||
in
|
||||
dirImports // {
|
||||
darwin = {
|
||||
imports = [
|
||||
dirImports.base
|
||||
tree.prev.darwin
|
||||
];
|
||||
};
|
||||
base = {
|
||||
imports = [
|
||||
dirImports.base
|
||||
dirImports.linux
|
||||
tree.prev.nixos
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
tokei
|
||||
nixpkgs-fmt
|
||||
pandoc
|
||||
apache-directory-studio
|
||||
hugo
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
let
|
||||
initvim = pkgs.callPackage
|
||||
({ stdenv, elinks, nodejs }: stdenv.mkDerivation {
|
||||
({ stdenv, nodejs }: stdenv.mkDerivation {
|
||||
name = "init.vim";
|
||||
src = ./init.vim;
|
||||
inherit nodejs elinks;
|
||||
inherit nodejs;
|
||||
buildInputs = [
|
||||
elinks
|
||||
nodejs
|
||||
];
|
||||
phases = [ "buildPhase" ];
|
||||
|
|
@ -44,10 +43,6 @@ in
|
|||
nvim-base16
|
||||
nvim-web-devicons
|
||||
telescope-nvim
|
||||
(nvim-treesitter.withPlugins (
|
||||
plugins: with plugins; pkgs.tree-sitter.allGrammars
|
||||
))
|
||||
nvim-ts-rainbow
|
||||
coc-yaml
|
||||
coc-git
|
||||
coc-css
|
||||
|
|
|
|||
|
|
@ -14,22 +14,6 @@ lua << EOF
|
|||
}
|
||||
})
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = { }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
}
|
||||
}
|
||||
require('neorg').setup {
|
||||
-- Tell Neorg what modules to load
|
||||
load = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
xdg = {
|
||||
Loading…
Add table
Add a link
Reference in a new issue