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

18
usr/README.md Normal file
View file

@ -0,0 +1,18 @@
# The usr directory
This directory contains all files specific to the local network(s) (host and user profiles, machines, configuration, add-ons, etc.).
> [!NOTE]
> This is where you can modify files.
- **config.yaml:** the main configuration file
- **homes:** additional or overloaded user profiles
- **modules:** additional or completed modules + host profiles
- **machines:** machine-specific configurations (hardware, etc.)
- **secrets:** your keys and passwords (sops)
> [!TIP]
> **Multiple network declaration:**
>
> The `config.yaml` contains a networks, hosts and users declarations. To manage several networks, follow the comments
> in the configuration file.

177
usr/config.yaml Normal file
View file

@ -0,0 +1,177 @@
# Nix generator configuration file for Darkone NixOS Framework (common file)
# Global network configuration is converted in lists / attSets to be used in
# your nix configuration through "network" special arg.
network:
domain: "darkone.lan" # required
timezone: "America/Miquelon"
locale: "fr_FR.UTF-8"
gateway:
hostname: "gateway" # required (if gateway key exists)
wan:
interface: "eth0" # required
gateway: "192.168.0.1" # required
lan:
interfaces: ["enu1u4"] # required
ip: "192.168.1.1"
prefixLength: 24
dhcp-range:
- "192.168.1.100,192.168.1.230,24h"
dhcp-extra-option: # option
- "option:ntp-server,191.168.1.1"
extraHosts:
"192.168.0.1": ["box"]
#------------------------------------------------------------------------------
# Nix DNF static hosts (nested hosts.<type>)
#------------------------------------------------------------------------------
# Static users
# -> profile is the HomeManager profile
# -> groups is used to select related hosts
users:
# A nix administrator
nixos:
uid: 1000
name: "An admin user"
profile: "admin"
groups: ["admin"]
# A real user with its own profile "darkone"
darkone:
uid: 1001
name: "Darkone Linux"
email: "darkone@darkone.yt"
profile: "darkone"
groups: ["admin", "media", "common"]
# A student with specific profile "student"
ethan:
uid: 1002
name: "Ethan"
profile: "student"
groups: ["sn", "tsn"]
# A child of my home network
esteban:
uid: 1003
name: "Esteban"
profile: "teenager"
groups: [ "kids", "common" ]
# Hosts declaration
# -> name: human readable name or description
# -> profile: the host profile related to this host
# -> users: a list of existing user logins
# -> groups: used to select related users
# -> tags: added to colmena tags for deployment filtering.
# -> local: true is only for the local (master) machine.
hosts:
# Static hosts
static:
# The gateway
- hostname: "gateway"
name: "Local Gateway"
arch: "aarch64-linux"
profile: "gateway"
groups: ["admin"]
aliases: ["gateway", "passerelle"]
services:
homepage:
ncps:
forgejo:
title: "Our local forge"
lldap:
# A laptop
- hostname: "my-laptop"
name: "My Laptop"
profile: "laptop"
users: ["nixos"]
groups: ["admin", "common"]
tags: ["laptops", "admin"]
aliases: ["my-laptop", "darkone"] # Host name aliases
interfaces:
- mac: "e8:ff:1e:d0:44:82"
ip: "192.168.1.2"
- mac: "e8:ff:1e:d0:44:83"
ip: "192.168.1.82"
services:
homepage:
domain: "laptop-home"
immich:
title: "My pictures"
description: "A very cool images app"
domain: "photos"
icon: "immich"
nextcloud:
domain: "cloud"
# Host groups by range (generated from min to max)
range:
# 12 workstations based on the profile "workstation"
- hostname: "pc%'02s"
name: "Workstation %d"
profile: "workstation"
range: [1, 4]
groups: ["tsn", "sn"]
hosts:
1:
interfaces:
- mac: "08:00:27:03:BB:20"
ip: "192.168.1.101"
2:
interfaces:
- mac: "08:00:27:AE:49:7F"
ip: "192.168.1.102"
3:
interfaces:
- mac: "08:00:27:EA:85:CB"
ip: "192.168.1.103"
4:
interfaces:
- mac: "08:00:27:A4:B1:36"
ip: "192.168.1.104"
# List of similar hosts (each item is a host)
list:
# 3 similar hosts (for the default network)
- hostname: "laptop-%s"
name: "Laptop %s"
profile: "home-laptop"
groups: ["common"]
users: ["darkone"]
hosts:
kids:
name: "Kids"
interfaces:
- mac: "f0:1f:af:13:61:c6"
ip: "192.168.1.20"
family:
name: "Kids"
interfaces:
- mac: "f0:1f:af:13:61:c7"
ip: "192.168.1.21"
# Nix DNF hosts from LLDAP (wip)
# Contains users and groups
# users <-> groups <-> hosts
#------------------------------------------------------------------------------
hostProvider:
lldap:
enabled: false
# Use nsswitch to login users, otherwise user configurations are
# generated in the nix configuration
#nss: false # Not implemented yet
url: "ldap://localhost:3890"
bind:
user: "admin"
passwordFile: "lldap" # located in usr/secrets

3
usr/homes/README.md Normal file
View file

@ -0,0 +1,3 @@
# The usr/homes directory
The contents of this folder work in the same way as `dnf/homes`, which you can adapt to the needs of your local network.

9
usr/homes/darkone.nix Normal file
View file

@ -0,0 +1,9 @@
# A unique user profile
{
pkgs,
lib,
config,
...
}:
import ./../../dnf/homes/nix-admin.nix { inherit pkgs lib config; }

View file

@ -0,0 +1,22 @@
# A unique user profile
{
# Is a nix administrator with additional home environment
imports = [
./../../../dnf/homes/nix-admin
./programs.nix
];
# Zed editor
darkone.home.zed.enable = true;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "25.05";
}

View file

@ -0,0 +1,54 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
# Outils CLI
asciidoc-full
asciidoctor
aspellDicts.fr
ccrypt
duf
htop
presenterm
ranger
zellij
# Développement, administration
gparted
#jetbrains.idea-ultimate # Compilation fail
nodejs_23
python3Full
vscode
# Réseau
#nettools
filezilla
nmap
# Productivité, multimédia
evince
geeqie
gimp
inkscape
super-productivity
yed
# Tweak
powerline
powerline-fonts
# TODO
#gpsd
#kdePackages.kdenlive
#opencpn
#programs.obs-studio.enable = true; # cf. plugins
#telegram-desktop
#viking
#whatsapp-for-linux
];
services.easyeffects = {
enable = true;
preset = "easyeffects-fw16";
};
}

1
usr/machines/README.md Normal file
View file

@ -0,0 +1 @@
Auto-imported machines configurations.

View file

@ -0,0 +1,3 @@
# DO NOT EDIT, this is a generated file.
{ imports = [ ]; }

View file

@ -0,0 +1,3 @@
# DO NOT EDIT, this is a generated file.
{ imports = [ ./host/admin-laptop.nix ]; }

View file

@ -0,0 +1,48 @@
{ lib, config, ... }:
let
cfg = config.darkone.host.admin-laptop;
in
{
options = {
darkone.host.admin-laptop.enable = lib.mkEnableOption "Darkone administration laptop";
};
config = lib.mkIf cfg.enable {
# Darkone modules
darkone = {
# Based on laptop framework profile
host.laptop.enable = true;
# Advanced user (developper / admin)
theme.advanced.enable = true;
# Nix administration features
admin.nix.enable = true;
# Hp printers
service.printing.enableHpPrinters = true;
# No email software
graphic.office.enableEmail = false;
# Virtualbox
graphic.virtualbox.enable = true;
# Music creation
graphic.music.enable = true;
# Gnome options
graphic.gnome.enableDashToDock = true;
#graphic.gnome.enableGsConnect = true;
#graphic.gnome.enableCaffeine = true;
# I'm the master, not a node
host.isNode = false;
};
# Host specific state version
system.stateVersion = "24.05";
};
}

3
usr/overlays/default.nix Normal file
View file

@ -0,0 +1,3 @@
# DO NOT EDIT, this is a generated file.
{ imports = [ ]; }

1
usr/secrets/lldap Normal file
View file

@ -0,0 +1 @@
test