First dnf test

This commit is contained in:
Darkone 2025-10-27 00:08:16 -02:00
commit d481a5e669
165 changed files with 41270 additions and 0 deletions

11
dnf/homes/README.md Normal file
View file

@ -0,0 +1,11 @@
# Homes files
> [!NOTE]
> Several users can have the same profile.
Depending on the user's profile (in this case “admin”), the flake will first create the user using `admin.nix` and then load the user's home-manager profile `admin/default.nix`.
```
admin.nix <-- Admin user creation with darkone.user.xxx.enable and additional options
admin/(...) <-- Home Manager specific files
```

16
dnf/homes/admin.nix Normal file
View file

@ -0,0 +1,16 @@
# Non-nix admin user profile
{
pkgs,
lib,
config,
...
}:
{
extraGroups = [
"networkmanager"
"wheel"
"corectrl"
];
}
// import ./advanced.nix { inherit pkgs lib config; }

View file

@ -0,0 +1,8 @@
# Darkone Network administrator
{
imports = [
./../advanced
./programs.nix
];
}

View file

@ -0,0 +1,28 @@
# Useful programs for network / sysadmin users
{ pkgs, ... }:
{
# NOTE: do NOT install busybox (incompatible readlink with nix build)
home.packages = with pkgs; [
bridge-utils
gnupg
inetutils
iptraf-ng
nettools
nmap
ntp
ntpstat
pinentry-curses
tcpdump
];
# programs.gpg.enable = true;
# services.gpg-agent = {
# enable = true;
# defaultCacheTtl = 34560000;
# maxCacheTtl = 34560000;
# enableSshSupport = true;
# enableZshIntegration = true;
# pinentryPackage = pkgs.pinentry-curses;
# };
}

9
dnf/homes/advanced.nix Normal file
View file

@ -0,0 +1,9 @@
# Advanced user profile (computer scientists, developers, admins)
{
pkgs,
lib,
config,
...
}:
{ shell = lib.mkIf config.programs.zsh.enable pkgs.zsh; } // import ./minimal.nix { inherit pkgs; }

View file

@ -0,0 +1,41 @@
_: {
programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultCommand = "rg --files --hidden";
defaultOptions = [
"--no-mouse"
"--info=inline-right"
];
};
# z command to replace cd
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
# ls alternative
programs.eza = {
enable = true;
enableZshIntegration = false;
};
# cat alternative + man pages
programs.bat.enable = true;
home.sessionVariables = {
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
MANROFFOPT = "-c";
};
# rg command -> recursive grep
programs.ripgrep.enable = true;
programs.btop = {
enable = true;
settings = {
proc_per_core = true;
update_ms = 1000;
};
};
}

View file

@ -0,0 +1,11 @@
# Profile for advanced users (computer scientists, developers, admins)
{
imports = [
./../minimal
./cli.nix
./git.nix
./programs.nix
./vim.nix
];
}

View file

@ -0,0 +1,54 @@
{
config,
users,
network,
...
}:
let
# Extraction of current user from host configuration
user = users.${config.home.username};
in
{
programs.git = {
enable = true;
userName = "${user.name}";
userEmail =
if (builtins.hasAttr "email" user) then
"${user.email}"
else
"${config.home.username}@${network.domain}";
aliases = {
amend = "!git add . && git commit --amend --no-edit";
pf = "!git push --force";
};
ignores = [
"*~"
"*.swp"
".vscode"
".idea"
];
extraConfig = {
core = {
editor = "vim";
whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
};
delta = {
enable = true;
options = {
"navigate" = true;
};
};
diff.tool = "vimdiff";
web.browser = "firefox";
push.default = "tracking";
push.autoSetupRemote = true;
pull.rebase = false;
init.defaultBranch = "main";
color.ui = true;
};
# Undefined but required from 02/2025
signing.format = "ssh";
};
}

View file

@ -0,0 +1,28 @@
# Useful programs for advanced users (computer scientists)
{ pkgs, ... }:
{
home.packages = with pkgs; [
bat
btop
ccrypt
dig
dos2unix
duf
gawk
htop
iw
jq
lsof
microfetch
pciutils # lspci pcilmr setpci
psmisc # killall, pstree, pslog, fuser...
pv
ranger
rename
rsync
strace
wirelesstools # ifrename iwconfig iwevent iwgetid iwlist iwpriv iwspy
zellij
];
}

196
dnf/homes/advanced/vim.nix Normal file
View file

@ -0,0 +1,196 @@
{ pkgs, ... }:
{
# Useful vim tools
home.packages = with pkgs; [
nodejs_24 # CoC
];
# TODO vim common module
# Conf complète : https://github.com/jagajaga/my_configs/blob/master/.nixpkgs/vimrc.nix
programs.vim = {
enable = true;
defaultEditor = true; # Define EDITOR envvar
# Vim plugins
plugins = with pkgs.vimPlugins; [
#vim-airline
LazyVim
coc-fzf
coc-git
coc-html
coc-json
coc-markdownlint
coc-nvim
coc-pairs
coc-sh
coc-yaml
ctrlp-vim
emmet-vim
fzf-vim
fzfWrapper
gruvbox
lightline-gruvbox-vim
lightline-vim
mini-completion
nerdtree
nerdtree-git-plugin
vim-gitgutter
vim-just
vim-lastplace
vim-nix
vim-polyglot
];
settings = {
ignorecase = true;
};
extraConfig = ''
set mouse=a
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Use Unix as the standard file type
set ffs=unix,dos,mac
" Enable syntax highlighting
syntax enable
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2
set shiftround "Round spaces to nearest shiftwidth multiple
set nojoinspaces "Don't convert spaces to tabs
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
" Always show the status line
set laststatus=2
" Format the status line
"set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
" Gruvbox (theme)
set termguicolors
set background=dark
let g:gruvbox_italic=1
colorscheme gruvbox
" Airline options
"let g:airline#extensions#tabline#enabled = 1
"let g:airline_powerline_fonts = 1
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
" Line numbers
set number relativenumber
" Highlight cursor line
hi CursorLineNr term=bold guifg=#fabd2f guibg=NONE
set cursorline
set cursorlineopt=number
" Git gutter colors
highlight clear SignColumn
highlight GitGutterAdd ctermfg=142 ctermbg=237 guifg=#b8bb26 guibg=NONE
highlight GitGutterDelete ctermfg=167 ctermbg=237 guifg=#fb4934 guibg=NONE
highlight GitGutterChange ctermfg=108 ctermbg=237 guifg=#8ec07c guibg=NONE
" Use system clipboard
set clipboard=unnamedplus
" Start NERDTree when Vim is started without file arguments.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif
" Start NERDTree when Vim starts with a directory argument.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
\ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
" Nix format
nnoremap <F2> :%!nixfmt -s<cr>
" Map <Space> to / (search) and <Ctrl>+<Space> to ? (backwards search)
map <space> /
map <C-space> ?
" Nerd tree
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
" Configuration CoC
set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
" Navigation
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)
" Auto-completion with Tab (TODO: voir comment améliorer)
"inoremap <silent><expr> <TAB>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ coc#refresh()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
inoremap <Tab> <Tab>
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Formatting du code
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
'';
};
# VIM spell files
# let
# nvim-spell-fr-utf8-dictionary = builtins.fetchurl {
# url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.spl";
# sha256 = "abfb9702b98d887c175ace58f1ab39733dc08d03b674d914f56344ef86e63b61";
# };
# nvim-spell-fr-utf8-suggestions = builtins.fetchurl {
# url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.sug";
# sha256 = "0294bc32b42c90bbb286a89e23ca3773b7ef50eff1ab523b1513d6a25c6b3f58";
# };
# in
# {
# home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary;
# home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions;
# }
}

3
dnf/homes/baby.nix Normal file
View file

@ -0,0 +1,3 @@
# Babies profile
{ pkgs, ... }: import ./minimal.nix { inherit pkgs; }

View file

@ -0,0 +1,8 @@
# Features for babies (education)
{
imports = [
./../minimal
./programs.nix
];
}

View file

@ -0,0 +1,10 @@
# Baby profile programs
{ pkgs, ... }:
{
home.packages = with pkgs; [
gcompris
leocad
tuxpaint
];
}

3
dnf/homes/children.nix Normal file
View file

@ -0,0 +1,3 @@
# Childs profile
{ pkgs, ... }: import ./minimal.nix { inherit pkgs; }

View file

@ -0,0 +1,8 @@
# Features for childs (education)
{
imports = [
./../minimal
./programs.nix
];
}

View file

@ -0,0 +1,27 @@
# Children profile programs
{ pkgs, ... }:
{
home.packages = with pkgs; [
avogadro2
celestia
chessx
gcompris
geogebra6
gnome-maps
kdePackages.blinken # Entrainement de la mémoire
kdePackages.kalzium # Tableau périodique
kdePackages.kgeography # Apprentissage de la géographie
kdePackages.kmplot # Maths
kdePackages.kturtle # LOGO
kdePackages.parley # Vocabulaire
klavaro
lenmus
leocad
solfege
superTuxKart
tuxpaint
verbiste
wike
];
}

3
dnf/homes/minimal.nix Normal file
View file

@ -0,0 +1,3 @@
# A minimal (real) user profile
_: { }

View file

@ -0,0 +1,9 @@
{
imports = [ ./zsh.nix ];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Default stateVersion for new homes
home.stateVersion = "25.05";
}

20
dnf/homes/minimal/zsh.nix Normal file
View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
programs.zsh = {
enable = true;
autocd = true;
plugins = [
{
name = "powerlevel10k-config";
src = ../../dotfiles;
file = "p10k.zsh";
}
{
name = "zsh-powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
];
};
}

9
dnf/homes/nix-admin.nix Normal file
View file

@ -0,0 +1,9 @@
# Darkone Network administrator user profile
{
pkgs,
lib,
config,
...
}:
import ./admin.nix { inherit pkgs lib config; }

View file

@ -0,0 +1,3 @@
# Darkone Network administrator
{ imports = [ ./../admin ]; }

3
dnf/homes/normal.nix Normal file
View file

@ -0,0 +1,3 @@
# A "normal" user profile (non-technical)
{ pkgs, ... }: import ./minimal.nix { inherit pkgs; }

View file

@ -0,0 +1,3 @@
# Normal user with graphic environment
{ imports = [ ./../minimal ]; }

9
dnf/homes/student.nix Normal file
View file

@ -0,0 +1,9 @@
# Computer science student profile
{
pkgs,
lib,
config,
...
}:
import ./advanced.nix { inherit pkgs lib config; }

View file

@ -0,0 +1,3 @@
# Computer science student home profile
{ imports = [ ./../advanced ]; }

3
dnf/homes/teenager.nix Normal file
View file

@ -0,0 +1,3 @@
# Teenager user profile
{ pkgs, ... }: import ./minimal.nix { inherit pkgs; }

View file

@ -0,0 +1,8 @@
# Features for teenagers
{
imports = [
./../minimal
./programs.nix
];
}

View file

@ -0,0 +1,44 @@
# Teenager profile programs
{ pkgs, ... }:
{
home.packages = with pkgs; [
#scilab-bin # math (ERR)
avogadro2 # molecules
celestia
chessx
geogebra6 # math
gnome-graphs
gnome-maps
inkscape
kdePackages.blinken # Entrainement de la mémoire
kdePackages.cantor
kdePackages.kalgebra # Outil mathématique
kdePackages.kalzium # Tableau périodique
kdePackages.kbruch # Exercices fractions
kdePackages.kgeography # Apprentissage de la géographie
kdePackages.kmplot # Maths
kdePackages.kturtle # LOGO
kdePackages.parley # Vocabulaire
klavaro
labplot
lenmus
leocad
lmms # Erreur de compilation avec pyliblo3 + overide python 312 ne fonctionne pas
maxima # math
mixxx
muse-sounds-manager
musescore
octaveFull # math
pingus
sage # math
solfege
soundfont-fluid
super-productivity
superTuxKart
tuxpaint
veloren
verbiste
wike
];
}