how do you use git #1
30
config/neovim/coc-settings.nix
Normal file
30
config/neovim/coc-settings.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
languageserver = {
|
||||||
|
dhall = {
|
||||||
|
command = "dhall-lsp-server";
|
||||||
|
filetypes = [ "dhall" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
haskell = {
|
||||||
|
command = "haskell-language-server-wrapper";
|
||||||
|
args = [ "--lsp" ];
|
||||||
|
rootPatterns = [
|
||||||
|
"stack.yaml"
|
||||||
|
"hie.yaml"
|
||||||
|
".hie-bios"
|
||||||
|
"BUILD.bazel"
|
||||||
|
".cabal"
|
||||||
|
"cabal.project"
|
||||||
|
"package.yaml"
|
||||||
|
];
|
||||||
|
filetypes = [ "hs" "lhs" "haskell" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
command = "rnix-lsp";
|
||||||
|
filetypes = [ "nix" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"yank.highlight.duration" = 700;
|
||||||
|
}
|
96
config/neovim/coc.vim
Normal file
96
config/neovim/coc.vim
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
" ------------------- COC config -----------------------
|
||||||
|
|
||||||
|
set updatetime=300
|
||||||
|
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
set signcolumn=yes
|
||||||
|
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
|
||||||
|
set cmdheight=2
|
||||||
|
|
||||||
|
" Use <c-space> for trigger completion.
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
|
||||||
|
" Use <cr> for confirm completion, `<C-g>u` means break undo chain at current position.
|
||||||
|
" Coc only does snippet and additional edit on confirm.
|
||||||
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
|
|
||||||
|
" Use `[c` and `]c` for navigate diagnostics
|
||||||
|
nmap <silent> [c <Plug>(coc-diagnostic-prev)
|
||||||
|
nmap <silent> ]c <Plug>(coc-diagnostic-next)
|
||||||
|
|
||||||
|
" Remap keys for gotos
|
||||||
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
|
|
||||||
|
" Remap for do codeAction of current line
|
||||||
|
nmap <leader>ac <Plug>(coc-codeaction)
|
||||||
|
|
||||||
|
" Remap for do action format
|
||||||
|
"nmap <silent> F <Plug>(coc-action-format) "does not work
|
||||||
|
nnoremap <silent> F :call CocAction('format')<CR>
|
||||||
|
|
||||||
|
" Temporary command to run brittany in Haskell projects (ghcide does not support it yet)
|
||||||
|
nnoremap <leader>af :r !brittany --write-mode=inplace %:p<CR>
|
||||||
|
|
||||||
|
" Temporary command to run hlint in Haskell projects (ghcide does not support it yet)
|
||||||
|
nnoremap <leader>al :AsyncRun hlint %:p<CR>
|
||||||
|
|
||||||
|
" Show signature help
|
||||||
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||||
|
|
||||||
|
" Use K for show documentation in preview window
|
||||||
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
|
|
||||||
|
function! s:show_documentation()
|
||||||
|
if &filetype == 'vim'
|
||||||
|
execute 'h '.expand('<cword>')
|
||||||
|
else
|
||||||
|
call CocAction('doHover')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Highlight symbol under cursor on CursorHold
|
||||||
|
" autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
|
|
||||||
|
" Remap for rename current word
|
||||||
|
nmap <leader>rn <Plug>(coc-rename)
|
||||||
|
|
||||||
|
" Show all diagnostics
|
||||||
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||||
|
" Find symbol of current document
|
||||||
|
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||||
|
" Search workspace symbols
|
||||||
|
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||||
|
" Do default action for next item.
|
||||||
|
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||||
|
" Do default action for previous item.
|
||||||
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||||
|
" Resume latest coc list
|
||||||
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||||
|
|
||||||
|
nnoremap <silent> <M-B> :call CocRequest('metals', 'workspace/executeCommand', { 'command': 'build-import' })<CR>
|
||||||
|
"nnoremap <silent> <M-Z> :ccl<CR>
|
||||||
|
|
||||||
|
" COC Snippets
|
||||||
|
|
||||||
|
" Use <C-l> for trigger snippet expand.
|
||||||
|
imap <C-l> <Plug>(coc-snippets-expand)
|
||||||
|
|
||||||
|
" Use <C-j> for select text for visual placeholder of snippet.
|
||||||
|
vmap <C-j> <Plug>(coc-snippets-select)
|
||||||
|
|
||||||
|
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
|
||||||
|
let g:coc_snippet_next = '<c-j>'
|
||||||
|
|
||||||
|
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
|
||||||
|
let g:coc_snippet_prev = '<c-k>'
|
||||||
|
|
||||||
|
" Use <C-j> for both expand and jump (make expand higher priority.)
|
||||||
|
imap <C-j> <Plug>(coc-snippets-expand-jump)
|
||||||
|
|
38
config/neovim/config.vim
Normal file
38
config/neovim/config.vim
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
filetype off
|
||||||
|
|
||||||
|
let mapleader=','
|
||||||
|
set shell=/run/current-system/sw/bin/fish
|
||||||
|
|
||||||
|
set viewoptions=folds,options,cursor,unix,slash
|
||||||
|
set encoding=utf-8
|
||||||
|
|
||||||
|
set termguicolors
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
set backspace=2
|
||||||
|
set laststatus=2
|
||||||
|
set noshowmode
|
||||||
|
|
||||||
|
set expandtab
|
||||||
|
set tabstop=4
|
||||||
|
set softtabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
|
||||||
|
set number
|
||||||
|
set numberwidth=1
|
||||||
|
set cmdheight=3
|
||||||
|
set textwidth=0
|
||||||
|
set linebreak
|
||||||
|
set showmatch
|
||||||
|
set matchtime=0
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
set cursorline
|
||||||
|
|
||||||
|
set incsearch
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
|
||||||
|
nnoremap Q <Nop>
|
||||||
|
nnoremap gQ <Nop>
|
||||||
|
|
||||||
|
:tnoremap <Esc> <C-\><C-n>
|
12
config/neovim/plugins.vim
Normal file
12
config/neovim/plugins.vim
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
" let g:hoogle_search_count = 20
|
||||||
|
" au BufNewFile,BufRead *.hs map <silent> <F1> :Hoogle<CR>
|
||||||
|
" au BufNewFile,BufRead *.hs map <silent> <C-c> :HoogleClose<CR>
|
||||||
|
|
||||||
|
nnoremap <C-t>n :NERDTreeFocus<CR>
|
||||||
|
map <C-t>f :NERDTreeToggle<CR>
|
||||||
|
map <C-t>s :NERDTreeFind<CR>
|
||||||
|
|
||||||
|
" let g:hoogle_fzf_cache_file = '~/.cache/fzf-hoogle/cache.json'
|
||||||
|
" nnoremap <leader>h :Hoogle <CR>
|
||||||
|
|
||||||
|
let g:vimtex_compiler_method = 'tectonic'
|
39
default.nix
Executable file
39
default.nix
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
{ config, inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) _;
|
||||||
|
in {
|
||||||
|
imports =
|
||||||
|
[ inputs.home-manager.nixosModules.home-manager ]
|
||||||
|
++ _.mapModulesRec' ./modules import;
|
||||||
|
|
||||||
|
# ‹nix flake check› bypasses, can be changed in the actual hosts
|
||||||
|
# config, useful for testing
|
||||||
|
fileSystems."/".device = lib.mkDefault "/dev/disk/by-label/nixos";
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 10;
|
||||||
|
|
||||||
|
nix = let
|
||||||
|
registry = lib.mapAttrs (_: v: { flake = v; }) (_.filterSelf inputs);
|
||||||
|
in {
|
||||||
|
package = pkgs.nixFlakes;
|
||||||
|
autoOptimiseStore = true;
|
||||||
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
binaryCaches = [
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
];
|
||||||
|
binaryCachePublicKeys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
registry = registry // { dotfiles.flake = inputs.self; };
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
curl git wget neovim
|
||||||
|
];
|
||||||
|
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
system.stateVersion = lib.mkDefault "21.05";
|
||||||
|
}
|
238
flake.lock
Executable file
238
flake.lock
Executable file
|
@ -0,0 +1,238 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"agenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641576265,
|
||||||
|
"narHash": "sha256-G4W39k5hdu2kS13pi/RhyTOySAo7rmrs7yMUZRH0OZI=",
|
||||||
|
"owner": "ryantm",
|
||||||
|
"repo": "agenix",
|
||||||
|
"rev": "08b9c96878b2f9974fc8bde048273265ad632357",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ryantm",
|
||||||
|
"repo": "agenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641205782,
|
||||||
|
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638122382,
|
||||||
|
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641459437,
|
||||||
|
"narHash": "sha256-z0IOcc6LLbVhyri/aTyWzRqJs3p1pBK9idOiMwCWiqs=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "c751aeb19e84a0a777f36fd5ea73482a066bb406",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libnbtplusplus": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1591558203,
|
||||||
|
"narHash": "sha256-QgvNvaoFflCXEPCCFBCeZvYTpuiwScBG7EosUgFwFNQ=",
|
||||||
|
"owner": "multimc",
|
||||||
|
"repo": "libnbtplusplus",
|
||||||
|
"rev": "dc72a20b7efd304d12af2025223fad07b4b78464",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "multimc",
|
||||||
|
"repo": "libnbtplusplus",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meson": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1640155612,
|
||||||
|
"narHash": "sha256-XrEIlf0W8mKEa97Uyc0w/187KBGEZOD+dJFNsn3UeNg=",
|
||||||
|
"owner": "mesonbuild",
|
||||||
|
"repo": "meson",
|
||||||
|
"rev": "06aad5233e6bec97bfe21ae79c85aa7171089d3b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mesonbuild",
|
||||||
|
"ref": "0.60",
|
||||||
|
"repo": "meson",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-hardware": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1639986101,
|
||||||
|
"narHash": "sha256-Ow0+pkY7qMw6lMAvR1mEdUT9svJnrkbaRoqp4bkMTpg=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixos-hardware",
|
||||||
|
"rev": "3f92db38374b2977aea8daf4c4fe2fa0eddbd60c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixos-hardware",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641528457,
|
||||||
|
"narHash": "sha256-FyU9E63n1W7Ql4pMnhW2/rO9OftWZ37pLppn/c1aisY=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "ff377a78794d412a35245e05428c8f95fef3951f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1640139330,
|
||||||
|
"narHash": "sha256-Nkp3wUOGwtoQ7EH28RLVJ7EqB/e0TU7VcsM7GLy+SdY=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "81cef6b70fb5d5cdba5a0fef3f714c2dadaf0d6d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641528457,
|
||||||
|
"narHash": "sha256-FyU9E63n1W7Ql4pMnhW2/rO9OftWZ37pLppn/c1aisY=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "ff377a78794d412a35245e05428c8f95fef3951f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"polymc": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"libnbtplusplus": "libnbtplusplus",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"quazip": "quazip"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641930261,
|
||||||
|
"narHash": "sha256-3RR/rjMFDYoA7qJHXLHdw1sauBCdO9kqMEGUpuxB1Sw=",
|
||||||
|
"owner": "PolyMC",
|
||||||
|
"repo": "PolyMC",
|
||||||
|
"rev": "3b524e99cceb734fa9f2433e3738ce0d185a75aa",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "PolyMC",
|
||||||
|
"repo": "PolyMC",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quazip": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1633895098,
|
||||||
|
"narHash": "sha256-+Of0M2IAoTf1CyC0teCpsyurv6xfqiBo84V49dSeNTA=",
|
||||||
|
"owner": "multimc",
|
||||||
|
"repo": "quazip",
|
||||||
|
"rev": "b1a72ac0bb5a732bf887a535ab75c6f9bedb6b6b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "multimc",
|
||||||
|
"repo": "quazip",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"agenix": "agenix",
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"meson": "meson",
|
||||||
|
"nixos-hardware": "nixos-hardware",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"polymc": "polymc",
|
||||||
|
"sway-borders": "sway-borders"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sway-borders": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1640037473,
|
||||||
|
"narHash": "sha256-gCdnim7excF11GEoni5YbIGTWSIx+wjHc8NO8lVNFts=",
|
||||||
|
"owner": "fluix-dev",
|
||||||
|
"repo": "sway-borders",
|
||||||
|
"rev": "5f4162f449b19f6d198b365fc6d3dd0febc065e2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "fluix-dev",
|
||||||
|
"repo": "sway-borders",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
73
flake.nix
Executable file
73
flake.nix
Executable file
|
@ -0,0 +1,73 @@
|
||||||
|
{
|
||||||
|
description = "Frosted Flakes";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
# NixOS unstable
|
||||||
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
|
# nixpkgs.url = "nixpkgs/nixos-21.05";
|
||||||
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
# home-manager
|
||||||
|
home-manager.url = "github:nix-community/home-manager/master";
|
||||||
|
# home-manager.url = "github:nix-community/home-manager/release-21.05";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
# agenix - age-encrypted secrets
|
||||||
|
agenix.url = "github:ryantm/agenix";
|
||||||
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
# nixos-hardware
|
||||||
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
||||||
|
nixos-hardware.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
/*
|
||||||
|
# fzf-hoogle
|
||||||
|
fzf-hoogle-vim.url = "github:monkoose/fzf-hoogle.vim";
|
||||||
|
fzf-hoogle-vim.flake = false;
|
||||||
|
|
||||||
|
# asyncrun-vim
|
||||||
|
asyncrun-vim.url = "github:skywind3000/asyncrun.vim";
|
||||||
|
asyncrun-vim.flake = false;
|
||||||
|
*/
|
||||||
|
meson.url = "github:mesonbuild/meson/0.60";
|
||||||
|
meson.flake = false;
|
||||||
|
|
||||||
|
sway-borders.url = "github:fluix-dev/sway-borders";
|
||||||
|
sway-borders.flake = false;
|
||||||
|
|
||||||
|
# blender-30.url = "github:blender/blender/blender-v3.0-release";
|
||||||
|
# blender-30.flake = false;
|
||||||
|
|
||||||
|
polymc.url = "github:PolyMC/PolyMC";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
lib = import ./lib { inherit pkgs inputs; lib = nixpkgs.lib; };
|
||||||
|
inherit (lib._) mapModules mapModulesRec mkHost;
|
||||||
|
|
||||||
|
mkPkgs = pkgs: overlays: import pkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
overlays = overlays ++ (lib.attrValues self.overlays);
|
||||||
|
};
|
||||||
|
|
||||||
|
pkgs = mkPkgs nixpkgs [ self.overlay inputs.polymc.overlay.${system} ];
|
||||||
|
in {
|
||||||
|
packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
|
||||||
|
overlay = final: prev: {
|
||||||
|
_ = self.packages."${system}";
|
||||||
|
# meson = inputs.meson;
|
||||||
|
# sway-unwrapped = inputs.sway-borders;
|
||||||
|
# blender = inputs.blender-30;
|
||||||
|
unstable = mkPkgs nixpkgs-unstable [];
|
||||||
|
};
|
||||||
|
overlays = mapModules ./overlays import;
|
||||||
|
nixosModules = mapModulesRec ./modules import;
|
||||||
|
nixosConfigurations = mapModules ./hosts (mkHost system);
|
||||||
|
devShell."${system}" =
|
||||||
|
import ./shell.nix { inherit pkgs; };
|
||||||
|
};
|
||||||
|
}
|
63
hosts/firepit/default.nix
Normal file
63
hosts/firepit/default.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{ pkgs, inputs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
user = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
curl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultUsers = {
|
||||||
|
aether = {
|
||||||
|
packages = [ ];
|
||||||
|
shell = "zsh";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
};
|
||||||
|
oatmealine = {
|
||||||
|
packages = [ ];
|
||||||
|
shell = "zsh";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keyboard = {
|
||||||
|
locale = "en_US.UTF-8";
|
||||||
|
variant = "qwerty";
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
# theme.active = "still";
|
||||||
|
shell.zsh.enable = true;
|
||||||
|
security = {
|
||||||
|
isLocalMachine = false;
|
||||||
|
};
|
||||||
|
desktop = {
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
ssh.enable = true;
|
||||||
|
postgres.enable = true;
|
||||||
|
gitea = {
|
||||||
|
enable = true;
|
||||||
|
site = "git.oat.zone";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
time.timeZone = "Europe/Frankfurt";
|
||||||
|
|
||||||
|
programs.ssh.startAgent = true;
|
||||||
|
services.openssh.startWhenNeeded = true;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "firepit";
|
||||||
|
};
|
||||||
|
}
|
11
hosts/firepit/secrets/secrets.nix
Normal file
11
hosts/firepit/secrets/secrets.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
let
|
||||||
|
userAether = "<...>";
|
||||||
|
userOatmealine = "<...>";
|
||||||
|
in {
|
||||||
|
"aether" = {
|
||||||
|
"userAether.age".publicKeys = [ userAether ];
|
||||||
|
};
|
||||||
|
"oatmealine" = {
|
||||||
|
"userOatmealine.age".publicKeys = [ userOatmealine ];
|
||||||
|
};
|
||||||
|
}
|
84
hosts/subsurface/default.nix
Normal file
84
hosts/subsurface/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
{ pkgs, inputs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
defaultUsers = {
|
||||||
|
aether = {
|
||||||
|
packages = with pkgs; [ htop curl mpc_cli gammastep discord obs-studio youtube-dl inkscape audacity dolphin firefox-wayland wl-clipboard steam bitwarden blender neofetch krita celluloid imv firefox zathura ];
|
||||||
|
uid = 1024;
|
||||||
|
isNormalUser = true;
|
||||||
|
shell = "zsh";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keyboard = {
|
||||||
|
locale = "en_US.UTF-8";
|
||||||
|
variant = "qwerty";
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
# theme.active = "still";
|
||||||
|
shell.zsh.enable = true;
|
||||||
|
security = {
|
||||||
|
isLocalMachine = true;
|
||||||
|
};
|
||||||
|
desktop = {
|
||||||
|
sway = {
|
||||||
|
enable = true;
|
||||||
|
term = "alacritty";
|
||||||
|
};
|
||||||
|
apps = {
|
||||||
|
mpc.enable = true;
|
||||||
|
alacritty.enable = true;
|
||||||
|
obs.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
|
menus = {
|
||||||
|
nwggrid.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
codium.enable = true;
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
gaming = {
|
||||||
|
minecraft.enable = true;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
llvm.enable = true;
|
||||||
|
haskell = {
|
||||||
|
enable = true;
|
||||||
|
version = "ghc902";
|
||||||
|
};
|
||||||
|
c.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
ssh.enable = true;
|
||||||
|
mpd = {
|
||||||
|
enable = true;
|
||||||
|
# TODO: Make this more dynamic?
|
||||||
|
musicDir = "/home/aether/Music";
|
||||||
|
user = "aether";
|
||||||
|
};
|
||||||
|
geoclue2.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Doxxing live stream
|
||||||
|
time.timeZone = "Europe/Dublin";
|
||||||
|
|
||||||
|
programs.ssh.startAgent = true;
|
||||||
|
services.openssh.startWhenNeeded = true;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
networkmanager.enable = true;
|
||||||
|
useDHCP = false;
|
||||||
|
interfaces.wlp1s0.useDHCP = true;
|
||||||
|
};
|
||||||
|
}
|
119
hosts/subsurface/hardware-configuration.nix
Normal file
119
hosts/subsurface/hardware-configuration.nix
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
# 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, inputs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
# inputs.nixos-hardware.nixosModules.microsoft-surface
|
||||||
|
];
|
||||||
|
|
||||||
|
# Kernel Modules
|
||||||
|
boot = {
|
||||||
|
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
initrd.kernelModules = [ ];
|
||||||
|
kernelPackages = pkgs.linuxPackages_zen;
|
||||||
|
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||||
|
kernelModules = [ "kvm-intel" "v4l2loopback" ];
|
||||||
|
loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
configurationLimit = 10;
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
modules.hardware = {
|
||||||
|
audio = {
|
||||||
|
enable = true;
|
||||||
|
enableExtraCompat = true;
|
||||||
|
};
|
||||||
|
graphics.enable = true;
|
||||||
|
fs = {
|
||||||
|
enable = true;
|
||||||
|
ssd.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# HiDPI
|
||||||
|
hardware.video.hidpi.enable = true;
|
||||||
|
|
||||||
|
# CPU
|
||||||
|
nix.maxJobs = lib.mkDefault 4;
|
||||||
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
|
# Power Management
|
||||||
|
powerManagement = {
|
||||||
|
powertop.enable = true;
|
||||||
|
cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
brightnessctl
|
||||||
|
];
|
||||||
|
|
||||||
|
# Filesystems
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/b892a566-b6d7-4f62-a384-71ccca4ff4d8";
|
||||||
|
fsType = "f2fs";
|
||||||
|
options = [ "defaults" "noatime" "nodiratime" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home" = {
|
||||||
|
device = "/dev/disk/by-uuid/f3a44427-a212-48c2-91e7-f40e82bbcc02";
|
||||||
|
fsType = "f2fs";
|
||||||
|
options = [ "defaults" "noatime" "nodiratime" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/etc/dotfiles" = {
|
||||||
|
device = "/dev/disk/by-uuid/2777d90a-20f0-4b35-88f1-653ba14114db";
|
||||||
|
fsType = "f2fs";
|
||||||
|
options = [ "defaults" "noatime" "nodiratime" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/C507-604E";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home/aether/Downloads" = {
|
||||||
|
device = "none";
|
||||||
|
fsType = "tmpfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56" = {
|
||||||
|
device = "/dev/disk/by-uuid/bf2d91f1-a6b3-4629-8755-76301b3f6f56";
|
||||||
|
# fsType = "f2fs";
|
||||||
|
options = [ "defaults" "noatime" "nodiratime" "user" "nofail" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home/aether/Videos" = {
|
||||||
|
device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/Videos";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home/aether/Pictures" = {
|
||||||
|
device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/Pictures";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home/aether/Documents" = {
|
||||||
|
device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/Documents";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/home/aether/Music" = {
|
||||||
|
device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/home delta delta/Music";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [{ device = "/dev/disk/by-uuid/e4a7edca-2c4e-4979-8368-377bc067b8bd"; }];
|
||||||
|
|
||||||
|
# Allows for hibernation
|
||||||
|
boot.resumeDevice = "/dev/disk/by-uuid/e4a7edca-2c4e-4979-8368-377bc067b8bd";
|
||||||
|
}
|
78
hosts/subsurface/hardware-configuration.nix.bak
Normal file
78
hosts/subsurface/hardware-configuration.nix.bak
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
# 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, inputs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
# inputs.nixos-hardware.nixosModules.microsoft-surface
|
||||||
|
];
|
||||||
|
|
||||||
|
# Kernel Modules
|
||||||
|
boot = {
|
||||||
|
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
initrd.kernelModules = [ ];
|
||||||
|
kernelPackages = pkgs.linuxPackages_zen;
|
||||||
|
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||||
|
kernelModules = [ "kvm-intel" "v4l2loopback" ];
|
||||||
|
loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
configurationLimit = 10;
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
modules.hardware = {
|
||||||
|
audio = {
|
||||||
|
enable = true;
|
||||||
|
enableExtraCompat = true;
|
||||||
|
};
|
||||||
|
graphics.enable = true;
|
||||||
|
fs = {
|
||||||
|
enable = true;
|
||||||
|
ssd.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# HiDPI
|
||||||
|
hardware.video.hidpi.enable = true;
|
||||||
|
|
||||||
|
# CPU
|
||||||
|
nix.maxJobs = lib.mkDefault 4;
|
||||||
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
|
# Power Management
|
||||||
|
powerManagement = {
|
||||||
|
powertop.enable = true;
|
||||||
|
cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
brightnessctl
|
||||||
|
];
|
||||||
|
|
||||||
|
# Filesystems
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-lable/nixos";
|
||||||
|
fsType = "f2fs";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
"/home/aether/Downloads" = {
|
||||||
|
fsType = "tmpfs";
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [{ device = "/dev/disk/by-label/swap"; }];
|
||||||
|
}
|
6
hosts/subsurface/secrets/secrets.nix
Normal file
6
hosts/subsurface/secrets/secrets.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
let
|
||||||
|
firepitAccess = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoaiYQuYPYO217IA8rGIVvbQCoVaqERGAGevq+WxutrcdUZraa2Zp44GEZEmNFVNlgm2FtkOV42vqwnx2gfkHmuYA38Cov9jbxtIv4ytaWve+UniNBtUF9De0ULqKTUErk5iBX7gBpg4hY2+GVSSrYJ4KZIwDbA6uNj7PTyQDSZrGfQMbFR52HEXttehg7/vMXUVwhnakpKk3v21bCQRNzc3K9dcFUDSTH1uOE1oEfKhGp2zHtnknLDlMIhGQcpwfOKPqURsbzXpln1EyEMlrudjMRDg/ZKsKxYuW0Lnbxqqifgm9ERvSeq+517j3QA2Z6EWLY5yejgcDiyDy8bvqV";
|
||||||
|
in {
|
||||||
|
"firepitAccess.age".publicKeys = [ firepitAccess ];
|
||||||
|
"firepitAccess.age".owner = "aether";
|
||||||
|
}
|
20
lib/README.md
Normal file
20
lib/README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Lib
|
||||||
|
|
||||||
|
The `default.nix` defines a lib extended with a `_` attribute under which mine
|
||||||
|
custom lib functions live. The `default.nix` loads every `.nix` file in the
|
||||||
|
`libs` (current) directory and imports it.
|
||||||
|
|
||||||
|
The importing is quite simple:
|
||||||
|
1. First the `libsInFolder` reads the contents of the `libs` directory, filters
|
||||||
|
out non `.nix` files and the `default.nix` file and then returns a list of
|
||||||
|
paths to the individual `.nix` files it found.
|
||||||
|
2. This list gets passed to `importLibs` which imports the libraries and
|
||||||
|
merges the individual imported attribute sets together, so that all the
|
||||||
|
functions are available directly under one attribute set.
|
||||||
|
3. This attribute then gets bind to the `_` attribute in the `lib` extension.
|
||||||
|
|
||||||
|
Individual `.nix` files can use the functions defined in other local library
|
||||||
|
files normally using the `nix._.someFunctionName`.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
TODO
|
129
lib/colors.nix
Normal file
129
lib/colors.nix
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (builtins) elemAt listToAttrs substring;
|
||||||
|
inherit (lib) concatStringsSep fixedWidthString nameValuePair
|
||||||
|
stringToCharacters sublist toInt toUpper zipListsWith;
|
||||||
|
inherit (lib._) joinWithSep;
|
||||||
|
in rec {
|
||||||
|
/* Converts a hex color string to RGB triplet, an array of exactly 3 elements
|
||||||
|
|
||||||
|
Type:
|
||||||
|
toRGB :: String -> [Int]
|
||||||
|
|
||||||
|
Example:
|
||||||
|
toRGB "ffFFff"
|
||||||
|
=> [ 255 255 255 ]
|
||||||
|
*/
|
||||||
|
toRGB = hex: let
|
||||||
|
chars = stringToCharacters hex;
|
||||||
|
r = sublist 0 2 chars;
|
||||||
|
g = sublist 2 2 chars;
|
||||||
|
b = sublist 4 2 chars;
|
||||||
|
/* Converts a pair of characters (array of two strings, each of one char
|
||||||
|
long) in hexadecimal to a number. Expects a valid hexadecimal string.
|
||||||
|
|
||||||
|
Type:
|
||||||
|
hexPairToNum :: [String] -> Int
|
||||||
|
|
||||||
|
Example:
|
||||||
|
hexPairToNum [ "F" "1" ]
|
||||||
|
=> 241
|
||||||
|
*/
|
||||||
|
hexPairToNum = pair: let
|
||||||
|
c1 = elemAt pair 0; c2 = elemAt pair 1;
|
||||||
|
hexMapping = {
|
||||||
|
"A" = 10;
|
||||||
|
"B" = 11;
|
||||||
|
"C" = 12;
|
||||||
|
"D" = 13;
|
||||||
|
"E" = 14;
|
||||||
|
"F" = 15;
|
||||||
|
};
|
||||||
|
toNum = c: if hexMapping ? ${toUpper c} then hexMapping.${toUpper c} else toInt c;
|
||||||
|
in 16 * (toNum c1) + (toNum c2);
|
||||||
|
in [
|
||||||
|
(hexPairToNum r)
|
||||||
|
(hexPairToNum g)
|
||||||
|
(hexPairToNum b)
|
||||||
|
];
|
||||||
|
|
||||||
|
/* Both ‹hexColor› and ‹rgbColor› accept a color in 6 char long hexadecimal
|
||||||
|
representation. Their variants ‹hexColor'› and ‹rgbaColor› accept an
|
||||||
|
additional parameter ‹opacity› specified as an int in range from 0 to 100.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Type:
|
||||||
|
hexColor :: String -> String
|
||||||
|
|
||||||
|
Example:
|
||||||
|
hexColor "FECACA"
|
||||||
|
=> "#FECACA"
|
||||||
|
*/
|
||||||
|
hexColor = color: "#" + color;
|
||||||
|
|
||||||
|
/* Type:
|
||||||
|
hexColor' :: String -> Int -> String
|
||||||
|
|
||||||
|
Example:
|
||||||
|
hexColor' "FECACA" 54
|
||||||
|
=> "#FECACA54"
|
||||||
|
*/
|
||||||
|
hexColor' = color: opacity: "#" + color + toString opacity;
|
||||||
|
|
||||||
|
_rgbColor = color: extra: "(" + (joinWithSep ((toRGB color) ++ extra) ", ") + ")";
|
||||||
|
|
||||||
|
/* Type:
|
||||||
|
rgbColor :: String -> String
|
||||||
|
|
||||||
|
Example:
|
||||||
|
rgbColor "FFFFFF"
|
||||||
|
=> "rgb(255, 255, 255)"
|
||||||
|
*/
|
||||||
|
rgbColor = color: "rgb" + _rgbColor color [];
|
||||||
|
|
||||||
|
/* Type:
|
||||||
|
rgbaColor :: String -> Int -> String
|
||||||
|
|
||||||
|
Example:
|
||||||
|
rgbaColor "FFFFFF" 42
|
||||||
|
=> "rgba(255, 255, 255, 0.42)"
|
||||||
|
*/
|
||||||
|
rgbaColor = color: _opacity: let
|
||||||
|
opacityStr = fixedWidthString 3 "0" (toString _opacity);
|
||||||
|
opacity = substring 0 1 opacityStr + "." + substring 1 2 opacityStr;
|
||||||
|
in "rgba" + _rgbColor color [opacity];
|
||||||
|
|
||||||
|
/* ‹colors› defines a color palette according to the Tailwind colors:
|
||||||
|
https://tailwindcss.com/docs/customizing-colors#color-palette-reference
|
||||||
|
|
||||||
|
Each individual color has 10 variants, for example to access the variant
|
||||||
|
‹700› of color ‹red› following notation is used: ‹colors.red._700›
|
||||||
|
|
||||||
|
The ‹_› in front of the variant is there because numbers cannot be
|
||||||
|
used as keys.
|
||||||
|
*/
|
||||||
|
colors = let
|
||||||
|
scaleDef = [ 50 100 200 300 400 500 600 700 800 900 ];
|
||||||
|
scale = s: listToAttrs (zipListsWith (variant: color: nameValuePair "_${toString variant}" color) scaleDef s);
|
||||||
|
in rec {
|
||||||
|
# Default palette
|
||||||
|
coolGray = scale [ "F9FAFB" "F3F4F6" "E5E7EB" "D1D5DB" "9CA3AF" "6B7280" "4B5563" "374151" "1F2937" "111827" ];
|
||||||
|
red = scale [ "FEF2F2" "FEE2E2" "FECACA" "FCA5A5" "F87171" "EF4444" "DC2626" "B91C1C" "991B1B" "7F1D1D" ];
|
||||||
|
amber = scale [ "FFFBEB" "FEF3C7" "FDE68A" "FCD34D" "FBBF24" "F59E0B" "D97706" "B45309" "92400E" "78350F" ];
|
||||||
|
emerald = scale [ "ECFDF5" "D1FAE5" "A7F3D0" "6EE7B7" "34D399" "10B981" "059669" "047857" "065F46" "064E3B" ];
|
||||||
|
blue = scale [ "EFF6FF" "DBEAFE" "BFDBFE" "93C5FD" "60A5FA" "3B82F6" "2563EB" "1D4ED8" "1E40AF" "1E3A8A" ];
|
||||||
|
indigo = scale [ "EEF2FF" "E0E7FF" "C7D2FE" "A5B4FC" "818CF8" "6366F1" "4F46E5" "4338CA" "3730A3" "312E81" ];
|
||||||
|
violet = scale [ "F5F3FF" "EDE9FE" "DDD6FE" "C4B5FD" "A78BFA" "8B5CF6" "7C3AED" "6D28D9" "5B21B6" "4C1D95" ];
|
||||||
|
pink = scale [ "FDF2F8" "FCE7F3" "FBCFE8" "F9A8D4" "F472B6" "EC4899" "DB2777" "BE185D" "9D174D" "831843" ];
|
||||||
|
|
||||||
|
# Extra
|
||||||
|
blueGray = scale [ "F8FAFC" "F1F5F9" "E2E8F0" "CBD5E1" "94A3B8" "64748B" "475569" "334155" "1E293B" "0F172A" ];
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
gray = coolGray;
|
||||||
|
yellow = amber;
|
||||||
|
green = emerald;
|
||||||
|
purple = violet;
|
||||||
|
};
|
||||||
|
}
|
25
lib/default.nix
Normal file
25
lib/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# _ _ _
|
||||||
|
# | (_) |__
|
||||||
|
# | | | '_ \
|
||||||
|
# | | | |_) |
|
||||||
|
# |_|_|_.__/
|
||||||
|
#
|
||||||
|
|
||||||
|
{ inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
lib.extend (lib: super:
|
||||||
|
let
|
||||||
|
inherit (builtins) attrNames map readDir;
|
||||||
|
inherit (lib) filterAttrs foldr hasSuffix;
|
||||||
|
|
||||||
|
importLib = file: import file { inherit inputs lib pkgs; };
|
||||||
|
merge = foldr (a: b: a // b) {};
|
||||||
|
importLibs = libs: merge (map importLib libs);
|
||||||
|
|
||||||
|
isLib = name: type: type == "regular" && name != "default.nix" && hasSuffix ".nix" name;
|
||||||
|
libPath = name: "${toString ./.}/${name}";
|
||||||
|
libsInFolder = map libPath (attrNames (filterAttrs isLib (readDir ./.)));
|
||||||
|
in {
|
||||||
|
_ = importLibs libsInFolder;
|
||||||
|
}
|
||||||
|
)
|
29
lib/modules.nix
Normal file
29
lib/modules.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (builtins) attrValues pathExists readDir;
|
||||||
|
inherit (lib) filterAttrs hasSuffix mapAttrs' mkDefault mkOption
|
||||||
|
nameValuePair nixosSystem removeSuffix types;
|
||||||
|
inherit (lib._) mapFilterAttrs attrValuesRec;
|
||||||
|
in rec {
|
||||||
|
mapModules' = dir: fn: dirfn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(_: v: v != null)
|
||||||
|
(name: type:
|
||||||
|
let
|
||||||
|
path = "${toString dir}/${name}";
|
||||||
|
in
|
||||||
|
if type == "directory" then
|
||||||
|
nameValuePair name (dirfn path)
|
||||||
|
# else if type == "regular" && name != "default.nix" && hasSuffix ".nix" name then
|
||||||
|
else if type == "regular" && hasSuffix ".nix" name then
|
||||||
|
nameValuePair (removeSuffix ".nix" name) (fn path)
|
||||||
|
else
|
||||||
|
nameValuePair "" null
|
||||||
|
)
|
||||||
|
(readDir dir);
|
||||||
|
|
||||||
|
mapModules = dir: fn: mapModules' dir fn (path: if pathExists "${path}/default.nix" then (fn path) else null);
|
||||||
|
mapModulesRec = dir: fn: mapModules' dir fn (path: mapModulesRec path fn);
|
||||||
|
mapModulesRec' = dir: fn: attrValuesRec (mapModulesRec dir fn);
|
||||||
|
}
|
19
lib/nixos.nix
Normal file
19
lib/nixos.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault nixosSystem;
|
||||||
|
in {
|
||||||
|
mkHost = system: path:
|
||||||
|
nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit lib inputs system; };
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
nixpkgs.pkgs = pkgs;
|
||||||
|
networking.hostName = mkDefault (baseNameOf path);
|
||||||
|
}
|
||||||
|
../.
|
||||||
|
(import path)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
20
lib/pkgs.nix
Normal file
20
lib/pkgs.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (pkgs.stdenv) mkDerivation;
|
||||||
|
in rec {
|
||||||
|
_buildBinScript = buildInputs: name: mkDerivation {
|
||||||
|
inherit name buildInputs;
|
||||||
|
|
||||||
|
src = builtins.path { path = ../bin; name = "dotfiles"; };
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
install -Dm755 $src/${name} $out/bin/${name}
|
||||||
|
patchShebangs $out/bin/${name}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
buildBinScript = _buildBinScript [];
|
||||||
|
|
||||||
|
buildBabashkaBinScript = _buildBinScript [ pkgs.babashka ];
|
||||||
|
}
|
88
lib/utils.nix
Normal file
88
lib/utils.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (builtins) attrValues readFile;
|
||||||
|
inherit (lib) concatStringsSep filterAttrs fold isAttrs mapAttrs' mkOption types;
|
||||||
|
in rec {
|
||||||
|
/* Map over ‹attrs› with ‹f› and then filter them using ‹pred›
|
||||||
|
|
||||||
|
Type:
|
||||||
|
mapFilterAttrs ::
|
||||||
|
(String -> a -> Bool) -> (String -> b -> AttrSet) -> AttrSet' -> AttrSet
|
||||||
|
where AttrSet' has a value of type ‹b› and AttrSet of type ‹a›
|
||||||
|
|
||||||
|
Example:
|
||||||
|
mapFilterAttrs (n: v: n == "foo" || v == "bar") (n: v: nameValuePair n v)
|
||||||
|
{ foo = "baz"; a = "bar"; b = "foo" };
|
||||||
|
=> { foo = "baz"; a = "bar"; }
|
||||||
|
*/
|
||||||
|
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
||||||
|
|
||||||
|
/* Recursively generates a list of values of ‹attr› even for nested attrs
|
||||||
|
|
||||||
|
Type:
|
||||||
|
attrValuesRec :: AttrSet -> [x]
|
||||||
|
|
||||||
|
Example:
|
||||||
|
attrValuesRec { foo = { bar = "baz"; }; a = "b"; }
|
||||||
|
=> ["baz" "b"]
|
||||||
|
*/
|
||||||
|
attrValuesRec = attr: fold (x: xs: (if isAttrs x then attrValuesRec x else [x]) ++ xs) [] (attrValues attr);
|
||||||
|
|
||||||
|
/* Filter the ‹self› key from the given ‹attr›
|
||||||
|
|
||||||
|
Type:
|
||||||
|
filterSelf :: AttrSet -> AttrSet
|
||||||
|
|
||||||
|
Example:
|
||||||
|
filterSelf { foo = "bar"; self = "baz"; }
|
||||||
|
=> { foo = "bar"; }
|
||||||
|
*/
|
||||||
|
filterSelf = attr: filterAttrs (n: _: n != "self") attr;
|
||||||
|
|
||||||
|
/* Maps the items of ‹list› to strings and concatenates them with ‹sep› in
|
||||||
|
between the individual items
|
||||||
|
|
||||||
|
Type:
|
||||||
|
joinWithSep :: [a] -> String -> String
|
||||||
|
‹a› should be a type that is convertable to string using ‹toString›
|
||||||
|
|
||||||
|
Example:
|
||||||
|
joinWithSep [ 42 "foo" 0 ] "-"
|
||||||
|
=> "42-foo-0"
|
||||||
|
*/
|
||||||
|
joinWithSep = list: sep: concatStringsSep sep (map toString list);
|
||||||
|
|
||||||
|
/* Reads the given ‹path› and appends the ‹extras› to it
|
||||||
|
|
||||||
|
Type:
|
||||||
|
configWithExtras :: Path -> String -> String
|
||||||
|
|
||||||
|
Example:
|
||||||
|
configWithExtras example.txt "Appended text"
|
||||||
|
=> "Some text from example\nAppended text"
|
||||||
|
Given that ‹example.txt› contains "Some text from example"
|
||||||
|
*/
|
||||||
|
configWithExtras = path: extras: "${readFile path}\n${extras}";
|
||||||
|
|
||||||
|
enable = { enable = true; };
|
||||||
|
|
||||||
|
/* A simplifiation for creating options
|
||||||
|
|
||||||
|
Example:
|
||||||
|
mkOpt types.str "foobar" "A very important option"
|
||||||
|
=> mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "foobar";
|
||||||
|
description = "A very important option";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
mkOpt = type: default: description:
|
||||||
|
mkOption { inherit type default description; };
|
||||||
|
|
||||||
|
/* Creates option without description */
|
||||||
|
mkOpt' = type: default: mkOpt type default null;
|
||||||
|
|
||||||
|
/* Alias for ‹mkOpt' types.bool› */
|
||||||
|
mkBoolOpt = default: mkOpt' types.bool default;
|
||||||
|
}
|
26
modules/agenix.nix
Normal file
26
modules/agenix.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ options, lib, inputs, pkgs, config, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
with lib;
|
||||||
|
with lib._;
|
||||||
|
let
|
||||||
|
inherit (inputs) agenix;
|
||||||
|
secretsDir = "${toString ../hosts}/${config.networking.hostName}/secrets";
|
||||||
|
secretsFile = "${secretsDir}/secrets.nix";
|
||||||
|
in {
|
||||||
|
/*
|
||||||
|
imports = [ agenix.nixosModules.age ];
|
||||||
|
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ];
|
||||||
|
|
||||||
|
age = {
|
||||||
|
secrets = mkIf (pathExists secretsFile) (mapAttrs (n: o: {
|
||||||
|
file = "${secretsDir}/" + n;
|
||||||
|
owner = o.owner;
|
||||||
|
}) (import secretsFile));
|
||||||
|
identityPaths = options.age.identityPaths.default ++ (filter pathExists [
|
||||||
|
# ".ssh/id_ed25519"
|
||||||
|
# ".ssh/id_rsa"
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
}
|
47
modules/desktop/apps/alacritty.nix
Normal file
47
modules/desktop/apps/alacritty.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ config, options, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.alacritty;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.alacritty = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
executable = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.alacritty}/bin/alacritty";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
/*
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
alacritty
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
home._.programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
/*
|
||||||
|
settings = {
|
||||||
|
background_opacity = theme.backgroundOpacity;
|
||||||
|
font = {
|
||||||
|
size = 12;
|
||||||
|
normal.family = theme.font.mono;
|
||||||
|
bold.family = theme.font.mono;
|
||||||
|
italic.family = theme.font.mono;
|
||||||
|
};
|
||||||
|
colors = {
|
||||||
|
primary = {
|
||||||
|
background = theme.colors.background;
|
||||||
|
foreground = theme.colors.foreground;
|
||||||
|
};
|
||||||
|
normal = theme.colors.backgroundScheme;
|
||||||
|
bright = theme.colors.foregroundScheme;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
24
modules/desktop/apps/firefox.nix
Normal file
24
modules/desktop/apps/firefox.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.firefox;
|
||||||
|
wayland = config.modules.desktop.sway.enable;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.firefox = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
/*
|
||||||
|
user.packages = if wayland then (with pkgs; [
|
||||||
|
firefox-wayland
|
||||||
|
]) else (with pkgs; [
|
||||||
|
firefox
|
||||||
|
]);
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
21
modules/desktop/apps/menus/nwggrid.nix
Normal file
21
modules/desktop/apps/menus/nwggrid.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, pkgs, inputs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.menus.nwggrid;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.menus.nwggrid = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
executable = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.nwg-launchers}/bin/nwggrid";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
modules.desktop.apps.nwg-launchers.enable = true;
|
||||||
|
};
|
||||||
|
}
|
24
modules/desktop/apps/menus/wofi.nix
Normal file
24
modules/desktop/apps/menus/wofi.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.wofi;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.wofi = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
executable = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.wofi}/bin/wofi";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
wofi
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
22
modules/desktop/apps/mpc.nix
Normal file
22
modules/desktop/apps/mpc.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ pkgs, config, lib, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.mpc;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.mpc = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
modules.services.mpd.enable = true;
|
||||||
|
/*
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
mpc_cli
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
17
modules/desktop/apps/nwg-launchers.nix
Normal file
17
modules/desktop/apps/nwg-launchers.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs, lib, options, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.nwg-launchers;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.nwg-launchers = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [ nwg-launchers ];
|
||||||
|
};
|
||||||
|
}
|
21
modules/desktop/apps/obs.nix
Normal file
21
modules/desktop/apps/obs.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, options, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.apps.obs;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.obs = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
/*
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
obs-studio
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
18
modules/desktop/default.nix
Normal file
18
modules/desktop/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop;
|
||||||
|
in {
|
||||||
|
options.modules.desktop = {
|
||||||
|
theme = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "still";
|
||||||
|
description = "Sets a particular styling and wallpaper configuration.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.dbus.enable = true;
|
||||||
|
};
|
||||||
|
}
|
35
modules/desktop/editors/codium.nix
Normal file
35
modules/desktop/editors/codium.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.editors.codium;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.editors.codium = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home._.programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
package = (pkgs.vscode-with-extensions.override {
|
||||||
|
vscode = pkgs.vscodium;
|
||||||
|
vscodeExtensions = with pkgs.vscode-extensions; [
|
||||||
|
ms-vsliveshare.vsliveshare
|
||||||
|
bbenoist.nix
|
||||||
|
zhuangtongfa.material-theme
|
||||||
|
pkief.material-icon-theme
|
||||||
|
vscodevim.vim
|
||||||
|
] ++ (if config.modules.dev.haskell.enable then [
|
||||||
|
haskell.haskell
|
||||||
|
justusadam.language-haskell
|
||||||
|
] else [ ]);
|
||||||
|
}).overrideAttrs (old: {
|
||||||
|
inherit (pkgs.vscodium) pname version;
|
||||||
|
});
|
||||||
|
extensions = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
53
modules/desktop/editors/neovim.nix
Normal file
53
modules/desktop/editors/neovim.nix
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{ config, inputs, pkgs, lib, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
configDir = config.configDir;
|
||||||
|
cfg = config.modules.desktop.editors.neovim;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.editors.neovim = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.configFile = {
|
||||||
|
/*
|
||||||
|
"nvim/init.vim" = {
|
||||||
|
text = let
|
||||||
|
configt = builtins.readFile "${configDir}/neovim/config.vim";
|
||||||
|
coct = builtins.readFile "${configDir}/neovim/coc.vim";
|
||||||
|
pluginst = builtins.readFile "${configDir}/neovim/plugins.vim";
|
||||||
|
in configt + coct + pluginst;
|
||||||
|
};
|
||||||
|
"nvim/coc-settings.json" = {
|
||||||
|
text = builtins.toJSON (import "${configDir}/neovim/coc-settings.nix");
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
home._.programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
# inputs.asyncrun-vim
|
||||||
|
multiple-cursors
|
||||||
|
nerdtree
|
||||||
|
vim-nix
|
||||||
|
fzf-vim
|
||||||
|
vim-devicons
|
||||||
|
] ++ (if config.modules.dev.haskell.enable then with pkgs.vimPlugins; [
|
||||||
|
ghcid
|
||||||
|
fzf-vim
|
||||||
|
# inputs.fzf-hoogle-vim
|
||||||
|
] else [ ]);
|
||||||
|
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
|
||||||
|
# withNodeJS = true;
|
||||||
|
# withPython3 = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
modules/desktop/gaming/minecraft.nix
Normal file
18
modules/desktop/gaming/minecraft.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.gaming.minecraft;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.gaming.minecraft = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enables Minecraft through the PolyMC launcher";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# user.packages = [ polymc ];
|
||||||
|
};
|
||||||
|
}
|
7
modules/desktop/gaming/srb2k.nix
Normal file
7
modules/desktop/gaming/srb2k.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ lib, pkgs, options, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.gaming.srb2k;
|
||||||
|
in {
|
||||||
|
}
|
22
modules/desktop/services/swayidle.nix
Normal file
22
modules/desktop/services/swayidle.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.services.swayidle;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.desktop.services.swayidle = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
/*
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
swayidle
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
20
modules/desktop/services/swaylock.nix
Normal file
20
modules/desktop/services/swaylock.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.services.swaylock;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.desktop.services.swaylock = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
swaylock
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
26
modules/desktop/services/waybar.nix
Normal file
26
modules/desktop/services/waybar.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.services.waybar;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.services.waybar = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home._.programs.waybar = with pkgs; {
|
||||||
|
enable = true;
|
||||||
|
settings = [{
|
||||||
|
height = 10;
|
||||||
|
modules-left = [ "sway/workspaces" "sway/window" ];
|
||||||
|
modules-center = [ "clock" ];
|
||||||
|
modules-right = [ "tray" "cpu" "memory" "battery#bat0" ];
|
||||||
|
}];
|
||||||
|
style = builtins.readFile "${config.home.configFile.waybar.source}/style.css";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
146
modules/desktop/sway.nix
Normal file
146
modules/desktop/sway.nix
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
{ options, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.sway;
|
||||||
|
audioSupport = config.modules.hardware.audio.enable;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.sway = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enables the sway window manager for Wayland.";
|
||||||
|
};
|
||||||
|
menu = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "nwggrid";
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
term = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "alacritty";
|
||||||
|
description = "Which terminal sway should default to.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
modules.hardware.graphics.enable = true;
|
||||||
|
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [ xwayland ];
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
wl-clipboard
|
||||||
|
swaybg
|
||||||
|
autotiling
|
||||||
|
brightnessctl
|
||||||
|
wdisplays
|
||||||
|
] ++ (if audioSupport then (with pkgs; [
|
||||||
|
playerctl
|
||||||
|
]) else [ ]);
|
||||||
|
*/
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = with pkgs; [
|
||||||
|
xdg-desktop-portal-wlr
|
||||||
|
xdg-desktop-portal-gtk
|
||||||
|
];
|
||||||
|
gtkUsePortal = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
autorun = true;
|
||||||
|
|
||||||
|
displayManager = {
|
||||||
|
sddm.enable = true;
|
||||||
|
defaultSession = "sway";
|
||||||
|
};
|
||||||
|
|
||||||
|
wacom.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules.desktop.apps."${cfg.term}".enable = true;
|
||||||
|
modules.desktop.apps.menus.${cfg.menu}.enable = true;
|
||||||
|
|
||||||
|
# modules.desktop.services.swaylock.enable = true;
|
||||||
|
modules.desktop.services.swayidle.enable = true;
|
||||||
|
# modules.desktop.services.mako.enable = true;
|
||||||
|
modules.desktop.services.waybar.enable = true;
|
||||||
|
|
||||||
|
home._.wayland.windowManager.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = true;
|
||||||
|
|
||||||
|
config = {
|
||||||
|
bars = [{ command = "waybar"; }];
|
||||||
|
modifier = "Mod4";
|
||||||
|
input."type:keyboard" = let kbcfg = config.keyboard; in {
|
||||||
|
xkb_layout = toLower (substring 3 2 kbcfg.locale);
|
||||||
|
xkb_variant = "," + kbcfg.variant;
|
||||||
|
};
|
||||||
|
input."type:touchpad" = {
|
||||||
|
tap = "enabled";
|
||||||
|
natural_scroll = "enabled";
|
||||||
|
scroll_method = "two_finger";
|
||||||
|
};
|
||||||
|
startup = [
|
||||||
|
# { command = "lock"; }
|
||||||
|
{ command = "autotiling"; }
|
||||||
|
# { command = "mako"; }
|
||||||
|
];
|
||||||
|
terminal = config.modules.desktop.apps.${cfg.term}.executable;
|
||||||
|
menu = config.modules.desktop.apps.menus.${cfg.menu}.executable;
|
||||||
|
output."eDP-1" = {
|
||||||
|
bg = "${config.modules.theme.wallpaper} fill";
|
||||||
|
scale = "1.5";
|
||||||
|
};
|
||||||
|
keybindings = let mod = config.home._.wayland.windowManager.sway.config.modifier; scProc = "wl-copy -t image/png && notify-send \"Screenshot Taken\""; in {
|
||||||
|
# "${mod}+l" = "exec lock";
|
||||||
|
"${mod}+q" = "reload";
|
||||||
|
"${mod}+Shift+c" = "kill";
|
||||||
|
"${mod}+p" = "exec ${config.home._.wayland.windowManager.sway.config.menu}";
|
||||||
|
"${mod}+Shift+Return" = "exec ${config.home._.wayland.windowManager.sway.config.terminal}";
|
||||||
|
"${mod}+Shift+e" = "exit";
|
||||||
|
|
||||||
|
"${mod}+1" = "workspace 1";
|
||||||
|
"${mod}+2" = "workspace 2";
|
||||||
|
"${mod}+3" = "workspace 3";
|
||||||
|
"${mod}+4" = "workspace 4";
|
||||||
|
"${mod}+5" = "workspace 5";
|
||||||
|
"${mod}+6" = "workspace 6";
|
||||||
|
"${mod}+7" = "workspace 7";
|
||||||
|
"${mod}+8" = "workspace 8";
|
||||||
|
"${mod}+9" = "workspace 9";
|
||||||
|
"${mod}+0" = "workspace 10";
|
||||||
|
|
||||||
|
"${mod}+Shift+1" = "move container to workspace 1";
|
||||||
|
"${mod}+Shift+2" = "move container to workspace 2";
|
||||||
|
"${mod}+Shift+3" = "move container to workspace 3";
|
||||||
|
"${mod}+Shift+4" = "move container to workspace 4";
|
||||||
|
"${mod}+Shift+5" = "move container to workspace 5";
|
||||||
|
"${mod}+Shift+6" = "move container to workspace 6";
|
||||||
|
"${mod}+Shift+7" = "move container to workspace 7";
|
||||||
|
"${mod}+Shift+8" = "move container to workspace 8";
|
||||||
|
"${mod}+Shift+9" = "move container to workspace 9";
|
||||||
|
"${mod}+Shift+0" = "move container to workspace 10";
|
||||||
|
|
||||||
|
"Print" = "exec grim -g \"$(slurp -d)\" - | ${scProc}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extraSessionCommands = ''
|
||||||
|
export XDG_SESSION_TYPE=wayland
|
||||||
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
export XDG_SESSION_DESKTOP=sway
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
'';
|
||||||
|
extraConfig = builtins.readFile "${config.home.configFile.sway.source}/config";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
23
modules/dev/c.nix
Normal file
23
modules/dev/c.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
withLLVM = config.modules.dev.llvm.enable;
|
||||||
|
cfg = config.modules.dev.c;
|
||||||
|
in {
|
||||||
|
options.modules.dev.c = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = if !withLLVM then with pkgs; [
|
||||||
|
gcc
|
||||||
|
] else with pkgs; [
|
||||||
|
clang_12
|
||||||
|
# clang-utils
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
11
modules/dev/default.nix
Normal file
11
modules/dev/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ options, config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
valgrind
|
||||||
|
nix-linter
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
28
modules/dev/haskell.nix
Normal file
28
modules/dev/haskell.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ config, pkgs, lib, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.haskell;
|
||||||
|
in {
|
||||||
|
options.modules.dev.haskell = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
version = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "ghc8107";
|
||||||
|
};
|
||||||
|
packages = mkOption {
|
||||||
|
type = types.listOf types.attrs;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs.haskell.packages."${cfg.version}"; [
|
||||||
|
ghc
|
||||||
|
cabal-install
|
||||||
|
] ++ config.modules.dev.haskell.packages;
|
||||||
|
};
|
||||||
|
}
|
19
modules/dev/llvm.nix
Normal file
19
modules/dev/llvm.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.llvm;
|
||||||
|
in {
|
||||||
|
options.modules.dev.llvm = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
llvm_12
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/nodejs.nix
Normal file
17
modules/dev/nodejs.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.nodejs;
|
||||||
|
in {
|
||||||
|
options.modules.dev.nodejs = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
packages = mkOption {
|
||||||
|
type = types.listOf types.attrs;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
38
modules/hardware/audio.nix
Normal file
38
modules/hardware/audio.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ options, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
#with lib.my;
|
||||||
|
let cfg = config.modules.hardware.audio;
|
||||||
|
in {
|
||||||
|
options.modules.hardware.audio = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enables audio support via PipeWire.";
|
||||||
|
};
|
||||||
|
enableExtraCompat = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enables the PulseAudio, ALSA, and JACK PipeWire compatability servers.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# sound.enable = false;
|
||||||
|
hardware.pulseaudio.enable = false; # fuck off pulseaudio
|
||||||
|
services.pipewire = mkMerge [
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
}
|
||||||
|
(mkIf cfg.enableExtraCompat
|
||||||
|
{
|
||||||
|
alsa.enable = cfg.enableExtraCompat;
|
||||||
|
alsa.support32Bit = cfg.enableExtraCompat;
|
||||||
|
pulse.enable = cfg.enableExtraCompat;
|
||||||
|
jack.enable = cfg.enableExtraCompat;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
user.extraGroups = [ "audio" ];
|
||||||
|
};
|
||||||
|
}
|
32
modules/hardware/fs.nix
Normal file
32
modules/hardware/fs.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.fs;
|
||||||
|
in {
|
||||||
|
options.modules.hardware.fs = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
ssd.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
sshfs
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.ssd.enable {
|
||||||
|
services.fstrim.enable = true;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvme-cli
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
21
modules/hardware/graphics.nix
Normal file
21
modules/hardware/graphics.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.graphics;
|
||||||
|
in {
|
||||||
|
options.modules.hardware.graphics = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.opengl.enable = true;
|
||||||
|
hardware.opengl.driSupport = true;
|
||||||
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
|
user.extraGroups = [ "video" ];
|
||||||
|
};
|
||||||
|
}
|
17
modules/keyboard.nix
Normal file
17
modules/keyboard.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.keyboard;
|
||||||
|
in {
|
||||||
|
options.keyboard = {
|
||||||
|
locale = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
variant = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
87
modules/security.nix
Normal file
87
modules/security.nix
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.security;
|
||||||
|
in {
|
||||||
|
options.modules.security = {
|
||||||
|
isLocalMachine = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = null;
|
||||||
|
description = "We can make some security tweaks depending on whether or not the machine is local.";
|
||||||
|
};
|
||||||
|
tmpOnTmpfs = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
cleanTmpDir = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = !cfg.tmpOnTmpfs;
|
||||||
|
};
|
||||||
|
allowedUDPPorts = mkOption {
|
||||||
|
type = types.listOf types.port;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
allowedTCPPorts = mkOption {
|
||||||
|
type = types.listOf types.port;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
assertions = [
|
||||||
|
{ assertion = cfg.isLocalMachine != null;
|
||||||
|
description = "The isLocalMachine property *must* be explicitly specified.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.editor = false;
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedUDPPorts = cfg.allowedUDPPorts;
|
||||||
|
allowedTCPPorts = cfg.allowedTCPPorts;
|
||||||
|
};
|
||||||
|
|
||||||
|
security.sudo.enable = false;
|
||||||
|
security.doas = {
|
||||||
|
enable = true;
|
||||||
|
extraRules = if cfg.isLocalMachine then [{ users = builtins.attrNames config.defaultUsers; }] else [];
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"kernel.sysrq" = 0;
|
||||||
|
|
||||||
|
# "net.ipv4.conf.default.rp_filter" = 1;
|
||||||
|
# "net.ipv4.conf.all.rp_filter" = 1;
|
||||||
|
|
||||||
|
"net.ipv4.conf.all.accept_source_code" = 0;
|
||||||
|
"net.ipv6.conf.all.accept_source_code" = 0;
|
||||||
|
"net.ipv4.conf.default.send_redirects" = 0;
|
||||||
|
"net.ipv4.conf.all.send_redirects" = 0;
|
||||||
|
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||||
|
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||||
|
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||||
|
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||||
|
"net.ipv4.conf.default.secure_redirects" = 0;
|
||||||
|
"net.ipv4.conf.all.secure_redirects" = 0;
|
||||||
|
"net.ipv4.tcp_syncookies" = 1;
|
||||||
|
"net.ipv4.tcp_rfc1337" = 1;
|
||||||
|
"net.ipv4.tcp_fastopen" = 3;
|
||||||
|
"net.ipv4.tcp_conjestion_control" = "bbr";
|
||||||
|
"net.core.default_qdisc" = "cake";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = {
|
||||||
|
initialPassword = "nixos";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.root = {
|
||||||
|
packages = [ pkgs.nologin ];
|
||||||
|
shell = pkgs.nologin;
|
||||||
|
hashedPassword = "!";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
17
modules/services/geoclue2.nix
Normal file
17
modules/services/geoclue2.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs, lib, config, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.geoclue2;
|
||||||
|
in {
|
||||||
|
options.modules.services.geoclue2 = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.geoclue2.enable = true;
|
||||||
|
};
|
||||||
|
}
|
30
modules/services/gitea.nix
Normal file
30
modules/services/gitea.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.gitea;
|
||||||
|
in {
|
||||||
|
options.modules.services.gitea = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
site = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "git.oat.zone";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
modules.services.postgres.enable = true;
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
domain = cfg.site;
|
||||||
|
rootUrl = "https://${cfg.site}/";
|
||||||
|
appName = "Gitea: Fire Pit hosted Git";
|
||||||
|
database = {
|
||||||
|
type = "postgres";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
52
modules/services/mpd.nix
Normal file
52
modules/services/mpd.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
audioSupport = config.modules.hardware.audio.enable;
|
||||||
|
cfg = config.modules.services.mpd;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.services.mpd = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Which user MPD should run on";
|
||||||
|
};
|
||||||
|
|
||||||
|
musicDir = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
defaultText = "$XDG_MUSIC_DIR";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
user = cfg.user;
|
||||||
|
};
|
||||||
|
|
||||||
|
home._.services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
musicDirectory = cfg.musicDir;
|
||||||
|
extraConfig =
|
||||||
|
''
|
||||||
|
zeroconf_enabled "no"
|
||||||
|
restore_paused "yes"
|
||||||
|
replaygain "track"
|
||||||
|
''
|
||||||
|
+ (if audioSupport then
|
||||||
|
''
|
||||||
|
audio_output {
|
||||||
|
type "pipewire"
|
||||||
|
name "PipeWire Audio Server"
|
||||||
|
server "127.0.0.1"
|
||||||
|
}
|
||||||
|
'' else "");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
19
modules/services/postgres.nix
Normal file
19
modules/services/postgres.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.postgres;
|
||||||
|
in {
|
||||||
|
options.modules.services.postgres = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
20
modules/services/ssh.nix
Normal file
20
modules/services/ssh.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ options, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
#with lib.my;
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.ssh;
|
||||||
|
in {
|
||||||
|
options.modules.services.ssh = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Provide system SSH support though OpenSSH.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.openssh.enable = true;
|
||||||
|
# services.sshd.enable = true;
|
||||||
|
};
|
||||||
|
}
|
33
modules/shell/fish.nix
Normal file
33
modules/shell/fish.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.shell.fish;
|
||||||
|
cfgDir = config.configDir;
|
||||||
|
in {
|
||||||
|
/*
|
||||||
|
options.modules.shell.fish = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
executable = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.fish}/bin/fish";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = cfg.enable {
|
||||||
|
home._.programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.configFile = {
|
||||||
|
"fish" = {
|
||||||
|
source = "${cfgDir}/fish";
|
||||||
|
target = "$HOME.config/fish";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
}
|
36
modules/shell/zsh.nix
Normal file
36
modules/shell/zsh.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.shell.zsh;
|
||||||
|
in {
|
||||||
|
options.modules.shell.zsh = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
executable = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.zsh}/bin/zsh";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# user.packages = with pkgs; [ nix-zsh-completions ];
|
||||||
|
|
||||||
|
# home.configFile."zsh".source = "${configDir}/zsh";
|
||||||
|
|
||||||
|
home._.programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
# dotDir = "${config.home.configFile."zsh".source}";
|
||||||
|
dotDir = ".config/zsh";
|
||||||
|
history = {
|
||||||
|
path = "$XDG_DATA_HOME/zsh/zsh_history";
|
||||||
|
save = 1000;
|
||||||
|
size = 1000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
41
modules/theme/default.nix
Normal file
41
modules/theme/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ config, pkgs, lib, options, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.theme;
|
||||||
|
in {
|
||||||
|
options.modules.theme = {
|
||||||
|
active = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "still";
|
||||||
|
description = "Theme defaults";
|
||||||
|
};
|
||||||
|
wallpaper = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = null;
|
||||||
|
description = "The main wallpaper";
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
gtk = {
|
||||||
|
theme = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "The global GTK theme";
|
||||||
|
};
|
||||||
|
iconTheme = {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Global GTK icon theme";
|
||||||
|
};
|
||||||
|
cursorTheme = {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Global GTK cursor theme";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.active != "") {
|
||||||
|
};
|
||||||
|
}
|
BIN
modules/theme/still/background.png
Normal file
BIN
modules/theme/still/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 MiB |
39
modules/theme/still/config/nwggrid/style.css
Normal file
39
modules/theme/still/config/nwggrid/style.css
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
button, label, image {
|
||||||
|
background: none;
|
||||||
|
border-style: none;
|
||||||
|
box-shadow: none;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
|
box-shadow: 0 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchbox {
|
||||||
|
background: none;
|
||||||
|
border-color: #999999;
|
||||||
|
color: #cccccc;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 20px
|
||||||
|
}
|
||||||
|
|
||||||
|
#separator {
|
||||||
|
background-color: rgba(200, 200, 200, 0.5);
|
||||||
|
margin-left: 500px;
|
||||||
|
margin-right: 500px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
#description {
|
||||||
|
margin-bottom: 20px
|
||||||
|
}
|
3
modules/theme/still/config/sway/config
Normal file
3
modules/theme/still/config/sway/config
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# font pango:SF Pro Display
|
||||||
|
|
||||||
|
gaps inner 10
|
88
modules/theme/still/config/waybar/style.css
Normal file
88
modules/theme/still/config/waybar/style.css
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
* {
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
font-family: "SF Pro Display";
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.hidden {
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Universal Attributes */
|
||||||
|
|
||||||
|
#tray,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#pulseaudio,
|
||||||
|
#battery,
|
||||||
|
#clock,
|
||||||
|
#workspaces button,
|
||||||
|
#window {
|
||||||
|
background: rgba(40, 50, 80, 0.60);
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgba(240, 240, 240, 1.00);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Font Sizes */
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Padding */
|
||||||
|
|
||||||
|
#workspaces button,
|
||||||
|
#window {
|
||||||
|
padding: 2px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
padding: 2px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#battery {
|
||||||
|
padding: 2px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Margins */
|
||||||
|
|
||||||
|
#workspaces button,
|
||||||
|
#window {
|
||||||
|
margin: 10px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
margin: 10px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#pulseaudio,
|
||||||
|
#battery {
|
||||||
|
margin: 10px 10px 0 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Colours */
|
||||||
|
|
||||||
|
#workspaces button.active {
|
||||||
|
background: rgba(40, 70, 125, 0.40);
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button:hover,
|
||||||
|
#battery.charging {
|
||||||
|
background: rgba(45, 80, 140, 1.00);
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent,
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
background: rgba(255, 100, 80, 1.00);
|
||||||
|
}
|
32
modules/theme/still/default.nix
Normal file
32
modules/theme/still/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
theme = config.modules.theme;
|
||||||
|
in {
|
||||||
|
config = mkIf (theme.active == "still") (mkMerge [
|
||||||
|
{
|
||||||
|
modules.theme.wallpaper = ./background.png;
|
||||||
|
home.configFile = with config.modules; mkMerge [
|
||||||
|
(mkIf desktop.services.waybar.enable {
|
||||||
|
"waybar" = { source = ./config/waybar; target = "$HOME.config/waybar"; recursive = true; };
|
||||||
|
})
|
||||||
|
/*
|
||||||
|
(mkIf desktop.apps.alacritty.enable {
|
||||||
|
"alacritty" = { source = ./config/alacritty; recursive = true; };
|
||||||
|
})
|
||||||
|
(mkIf desktop.apps.wofi.enable {
|
||||||
|
"wofi" = { source = ./config/wofi; recursive = true; };
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
(mkIf desktop.sway.enable {
|
||||||
|
"sway" = { source = ./config/sway; target = "$HOME.config/sway"; recursive = true; };
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf desktop.apps.nwg-launchers.enable {
|
||||||
|
"nwg-launchers/nwggrid/style.css" = { source = ./config/nwggrid/style.css; };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
78
modules/users.nix
Normal file
78
modules/users.nix
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
{ options, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
defaultUsers = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Collection of users";
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
_ = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Universal home-level user configuration";
|
||||||
|
};
|
||||||
|
configFile = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "(XDG) Configuration files managed by home-manager";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
user = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Universal system-level user configuration";
|
||||||
|
};
|
||||||
|
configDir = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = ../config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
user = {
|
||||||
|
packages = with pkgs; [ curl ];
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
shell = {};
|
||||||
|
home = "/home/default";
|
||||||
|
isNormalUser = false;
|
||||||
|
isSystemUser = false;
|
||||||
|
group = "";
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
home._ = {
|
||||||
|
home.stateVersion = config.system.stateVersion;
|
||||||
|
# home.file = mkAliasDefinitions options.home.file;
|
||||||
|
xdg.enable = true;
|
||||||
|
xdg.configFile = mkAliasDefinitions options.home.configFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
sessionVariables = {
|
||||||
|
XDG_CACHE_HOME = "$HOME/.cache";
|
||||||
|
XDG_CONFIG_HOME = "$HOME/.config";
|
||||||
|
XDG_DATA_HOME = "$HOME/.local/share";
|
||||||
|
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||||
|
XDG_DESKTOP_DIR = "$HOME";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = mapAttrs (user: prop: /* (mkAliasDefinitions options.user) // */ {
|
||||||
|
packages = prop.packages;
|
||||||
|
extraGroups = prop.extraGroups;
|
||||||
|
shell = pkgs."${config.defaultUsers."${user}".shell}";
|
||||||
|
home = "/home/${user}";
|
||||||
|
isNormalUser = true;
|
||||||
|
group = user;
|
||||||
|
}) config.defaultUsers;
|
||||||
|
|
||||||
|
home-manager.users = mapAttrs (user: prop: mkAliasDefinitions options.home._
|
||||||
|
) config.defaultUsers;
|
||||||
|
};
|
||||||
|
}
|
21
nixos.nix
Executable file
21
nixos.nix
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
{ lib, inputs, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) nixosSystem mkDefault;
|
||||||
|
in {
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
mkHost = system: path:
|
||||||
|
nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit lib inputs system; };
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
nixpkgs.pkgs = pkgs;
|
||||||
|
networking.hostName = mkDefault (baseNameOf path);
|
||||||
|
}
|
||||||
|
../.
|
||||||
|
(import path)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
0
overlays/dummy
Normal file
0
overlays/dummy
Normal file
7
overlays/wofi.nix
Normal file
7
overlays/wofi.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
final: prev: {
|
||||||
|
wofi = (prev.wofi.override {
|
||||||
|
stdenv = prev.clang12Stdenv;
|
||||||
|
}).overrideAttrs (old: {
|
||||||
|
"NIX_CFLAGS_COMPILE" = "-Os -march=native";
|
||||||
|
});
|
||||||
|
}
|
49
packages/apple-otf/default.nix
Normal file
49
packages/apple-otf/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ fetchurl, lib, p7zip, stdenv }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "otf-apple";
|
||||||
|
version = "1.0";
|
||||||
|
|
||||||
|
buildInputs = [ p7zip ];
|
||||||
|
src = [
|
||||||
|
(fetchurl {
|
||||||
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
|
||||||
|
sha256 = "+JF3SyNi+6rEVIEg/Llqu0w/z8gqBbbLtP3cCl9Kqjo=";
|
||||||
|
})
|
||||||
|
(fetchurl {
|
||||||
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
|
||||||
|
sha256 = "SHZHMCpqlrLH/3cEbIcnZg4lDQYl765bVO3v1o1D6hg=";
|
||||||
|
})
|
||||||
|
(fetchurl {
|
||||||
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
|
||||||
|
sha256 = "8niJPk3hGfK1USIs9eoxZ6GlM4aZ7ZObmQj2Zomj+Go=";
|
||||||
|
})
|
||||||
|
(fetchurl {
|
||||||
|
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
|
||||||
|
sha256 = "MAxQkdR40YUDl7z0OYbuwiueOoB2JuYikIu11CqiAto=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
sourceRoot = "./";
|
||||||
|
|
||||||
|
preUnpack = "mkdir fonts";
|
||||||
|
|
||||||
|
unpackCmd = ''
|
||||||
|
7z x $curSrc >/dev/null
|
||||||
|
dir="$(find . -not \( -path ./fonts -prune \) -type d | sed -n 2p)"
|
||||||
|
cd $dir 2>/dev/null
|
||||||
|
7z x *.pkg >/dev/null
|
||||||
|
7z x Payload~ >/dev/null
|
||||||
|
mv Library/Fonts/*.otf ../fonts/
|
||||||
|
cd ../
|
||||||
|
rm -R $dir
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/fonts/opentype/{SF\ Pro,SF\ Mono,SF\ Compact,New\ York}
|
||||||
|
cp -a fonts/SF-Pro*.otf $out/share/fonts/opentype/SF\ Pro
|
||||||
|
cp -a fonts/SF-Mono*.otf $out/share/fonts/opentype/SF\ Mono
|
||||||
|
cp -a fonts/SF-Compact*.otf $out/share/fonts/opentype/SF\ Compact
|
||||||
|
cp -a fonts/NewYork*.otf $out/share/fonts/opentype/New\ York
|
||||||
|
'';
|
||||||
|
}
|
29
packages/srb2k/default.nix
Normal file
29
packages/srb2k/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, SDL2
|
||||||
|
, SDL2_mixer
|
||||||
|
, libgme
|
||||||
|
, fetchFromGitLab
|
||||||
|
, cmake
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "srb2k";
|
||||||
|
version = "1.3";
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
owner = "himie";
|
||||||
|
repo = "kart-public";
|
||||||
|
rev = "8cd205cd2807c6a2064935c8b873972c6570e715";
|
||||||
|
sha256 = "0";
|
||||||
|
};
|
||||||
|
|
||||||
|
buldInputs = [
|
||||||
|
SDL2
|
||||||
|
SDL2_mixer
|
||||||
|
libgme
|
||||||
|
cmake
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = [ "-march=native" ];
|
||||||
|
}
|
17
shell.nix
Executable file
17
shell.nix
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
let nixBin =
|
||||||
|
writeShellScriptBin "nix" ''
|
||||||
|
${nixFlakes}/bin/nix --option experimental-features "nix-command flakes" "$@"
|
||||||
|
'';
|
||||||
|
in mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
git
|
||||||
|
nix-zsh-completions
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
export FLAKE="$(pwd)"
|
||||||
|
export PATH="$FLAKE/bin:${nixBin}/bin:$PATH"
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue