Compare commits

..

22 Commits

Author SHA1 Message Date
19258654cf nixos-manual : ajustement clef de config suite migration NixOS 19.03 2019-05-26 13:07:20 +02:00
7a7bcc99f2 EXP désactivation de darcs 2019-05-18 12:15:09 +02:00
dddc3e79e0 ajout font awesome 2019-05-18 12:14:23 +02:00
1e8b78d720 make: ajout cible 'list-installed-packages' 2019-05-18 12:14:23 +02:00
366eebee8a radio : compilation ok gnu-radio 2019-05-18 12:14:23 +02:00
5ecdc764ac make: commande lancer awesome en mode de test 2019-05-18 12:14:23 +02:00
Yves Dubromelle
a5e03f769b /!\ migration à nixos 19.03 (18.03 plus mis à jour) 2019-05-09 12:30:21 +02:00
Yves Dubromelle
c642afb7e6 formater de code haskell en vogue 2019-05-09 08:24:26 +02:00
Yves Dubromelle
1127daa925 désactivation de paquets haskell qui ne build plus 2019-05-09 08:23:44 +02:00
Jean-Pierre PRUNARET
328eabc735 ssh: augmentation du nombre de connexions simultanées en mode proxy 2018-12-31 14:17:45 +01:00
Jean-Pierre PRUNARET
f2247b6e3e Revert "l'attribut de génération des pages de man a changé de nom (-> documentation.man.enable)"
This reverts commit 0c47de1cb1.
2018-05-05 22:15:06 +02:00
Jean-Pierre PRUNARET
0073763f32 Revert "munin : blocage du module car refuse de s'installer" -> fonctionne avec nixos stable
This reverts commit 8dcdea29c1.
2018-05-05 22:11:04 +02:00
e2ba892109 /!\ FORCE NIXOS 18.03 pour corriger une infinite recursion sur nix 2018-05-05 22:10:48 +02:00
0c47de1cb1 l'attribut de génération des pages de man a changé de nom (-> documentation.man.enable) 2018-04-18 07:34:36 +02:00
8dcdea29c1 munin : blocage du module car refuse de s'installer 2018-04-07 10:41:04 +02:00
cffcd9bd3e makefile: utilisation de variable globale 2018-03-04 18:29:42 +01:00
3f80d6be6e scanner: activation du service + driver HP 2018-03-04 13:13:13 +01:00
e94b16fce7 ahout de "." dans les descriptions 2018-03-02 08:02:41 +01:00
3f038be64a template : ajout d'un exemple d'assertion 2018-03-02 07:57:10 +01:00
76fce51cf0 munin: config notifications 2018-02-16 00:32:52 +01:00
264a782227 ajout options de config pour quagga 2018-01-18 22:56:20 +01:00
e56040b333 u2f: import configuration pour activer le support des clefs FIDO / u2f
Notes :
- import de conf active sur radx
- fonctionne avec Chromium & Github
- ne fonctionne pas avec Firefox & Github
2018-01-17 21:08:25 +01:00
17 changed files with 124 additions and 23 deletions

View File

@@ -24,10 +24,17 @@ clean-log:
full-auto: submodules-update upgrade clean optimise
@date
list-installed-packages:
@# source : https://functor.tokyo/blog/2018-02-20-show-packages-installed-on-nixos
@# https://www.domenkozar.com/2014/01/02/getting-started-with-nix-package-manager/
@#nixos-option environment.systemPackages
nixos-option environment.systemPackages | head -2 | tail -1 | sed -e 's/ /\n/g' | cut -d- -f2- | sort | uniq| sed -e 's/"$$//'
optimise:
$(TIME) nix-store --optimise
$(TIME) nix optimise-store
rebuild-build:
nix-channel --add https://nixos.org/channels/nixos-19.03 nixos
$(TIME) time nixos-rebuild build --fallback --show-trace
rebuild-switch:
@@ -43,14 +50,14 @@ show-roots:
nix-store --gc --print-roots
show-time:
-@$(CHRONY_STATUS)
#CHRONY_STATUS='chronyc tracking' CHRONY_STATS='chronyc sources -v' ${CHRONY_STATS} && watch -d -n 20 "${CHRONY_STATUS} && echo "--" && ${CHRONY_STATS}"
-@watch -d -n 20 "$(CHRONY_STATUS) && echo "--" && $(CHRONY_STATS)"
-@$(CHRONY_STATUS) && $(CHRONY_STATS)
-@watch -d -n 5 "$(CHRONY_STATUS) && echo "--" && $(CHRONY_STATS)"
store-repair:
$(TIME) nix-store --verify --check-contents --repair
upgrade:
nix-channel --add https://nixos.org/channels/nixos-19.03 nixos
$(TIME) nixos-rebuild switch --upgrade --fallback --show-trace
##--------- Commandes spécifiques pour NixOS -- Opérations non courantes
@@ -105,3 +112,6 @@ tmpfs-umount:
tmpfs-destroy: tmpfs-umount
rmdir /mnt/tmpfs
##- Test awesome
test-awesome:
Xephyr :5 & sleep 1; DISPLAY=:5 awesome

View File

@@ -39,6 +39,7 @@ mkIf currentMachine.profiles.isDesktopEnvironment {
fira # police créée pour Firefox
fira-code # idem fira-mono + ligatures pour la programmation
fira-mono # dérivée de fira en monospace
font-awesome_5 # Jeux de police, utilisé avec Latex
hack-font # police monospace créée explicitement pour coder
hasklig # police dérivée de source-code-pro mais avec des ligatures
];

View File

@@ -21,7 +21,7 @@ environment.systemPackages = with pkgs; [
clawsMail
hexchat
quasselClient
mumble
#mumble
pidgin
thunderbird

View File

@@ -13,6 +13,6 @@ mkIf (flags.developpement-haskell && flags.graphical) {
environment.systemPackages = with pkgs; [
] ++ (with pkgs.haskellPackages; [
# Haskell lib
threadscope # visualisation des threads (<bidule>.eventlog)
#threadscope # visualisation des threads (<bidule>.eventlog)
]);
}

View File

@@ -12,9 +12,9 @@ mkIf (flags.radio && flags.graphical) {
# Paquets
environment.systemPackages = with pkgs; [
## GUI
gqrx # GUI
#gnuradio # Software Defined Radio (SDR) software
gnuradio-with-packages
gqrx # GUI
gnuradio # Software Defined Radio (SDR) software
gnuradio-with-packages # Software Defined Radio (SDR) software
## A Trier
#

View File

@@ -19,8 +19,9 @@ mkIf flags.developpement-haskell {
] ++ (with pkgs.haskellPackages; [
# Haskell lib
autoproc # ? procmail
darcs # gestionnaire de version éponyme
ghc-mod # outil d'analyse de code haskell utilisé par IDE
#brittany # formatteur de code
#darcs # gestionnaire de version éponyme
#ghc-mod # outil d'analyse de code haskell utilisé par IDE
hindent # indentation code
hlint # qualite de code, analyse statique de code + astuces & bonnes pratiques
#postgrest # mapper HTTP <-> PostgreSQL
@@ -29,7 +30,7 @@ mkIf flags.developpement-haskell {
turtle # genre shell-scripting
# Application perso
hahp
#hahp
pandoc-filter-graphviz # filtre pour utiliser graphviz à partir de pandoc
]);
}

View File

@@ -15,6 +15,7 @@ in
./localisation.nix
./network.nix
#./network-ipv6.nix
./u2f.nix
./udev.nix
# commandées par config-generator

View File

@@ -12,7 +12,7 @@ in
nix.buildCores = 0;
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "18.03";
system.stateVersion = "19.03";
# copies the NixOS configuration file (usually /etc/nixos/configuration.nix) and links it from the resulting system (getting to /run/current-system/configuration.nix)
system.copySystemConfiguration = true;
@@ -27,7 +27,8 @@ in
boot.cleanTmpDir = true;
# Activation des pages de manuel
programs.man.enable = true;
documentation.man.enable = true;
# Paquets
environment = {

41
configuration/u2f.nix Normal file
View File

@@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configurationFlags;
in
mkIf true {
# Ajout du support des yobikey & hyperfido
## source des valeurs udev : https://github.com/Yubico/libu2f-host/blob/master/70-u2f.rules
## source car udev sur nixos semble ancien : https://raw.githubusercontent.com/Yubico/libu2f-host/master/70-old-u2f.rules
services.udev.extraRules = ''
# this udev file should be used with udev older than 188
ACTION!="add|change", GOTO="u2f_end"
# Yubico YubiKey
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", GROUP="plugdev", MODE="0660"
# Happlink (formerly Plug-Up) Security KEY
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0", GROUP="plugdev", MODE="0660"
# Neowave Keydo and Keydo AES
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1e0d", ATTRS{idProduct}=="f1d0|f1ae", GROUP="plugdev", MODE="0660"
# HyperSecu HyperFIDO
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="096e", ATTRS{idProduct}=="0880", GROUP="plugdev", MODE="0660"
LABEL="u2f_end"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="audio", MODE="0666", SYMLINK+="rtl_sdr"
'';
security.pam.u2f.enable = true;
environment.systemPackages = with pkgs; [
libu2f-host
];
}

View File

@@ -22,4 +22,11 @@ mkIf true {
allowedUDPPorts = [
];
};
} // {
assertions = [
{
assertion = true;
message = "Assetion toujours valide.";
}
];
}

View File

@@ -62,10 +62,10 @@ let
configurationOptions = {
ipAddress = mkOption {
description = "Adresse IP";
description = "Adresse IP.";
type = lib.types.string;
};
nix-serve-server = mkEnableOption "nix-serve server";
nix-serve-server = mkEnableOption "nix-serve server.";
nix-serve-client = {
enable = mkEnableOption "nix-serve client";
servers = mkOption {
@@ -76,7 +76,7 @@ let
};
tinc = {
enable = mkEnableOption "Enable tinc service";
enable = mkEnableOption "Enable tinc service.";
dnsFQDN = mkOption {
example = "device.example.net.";
description = "DNS name of host pointing to tunnel IP.";
@@ -105,11 +105,26 @@ let
Mode = router
ConnecTo = bar
'';
description = "Configuration supplémentaire pour tinc";
description = "Configuration supplémentaire pour tinc.";
type = lib.types.string;
};
};
quagga = {
enable = mkEnableOption "Enable Quagga + BGP service";
bgpConfig = mkOption {
type = types.lines;
default = "";
example =''
router bgp 65001
neighbor 10.0.0.1 remote-as 65001
'';
description = ''
BGP configuration statements.
'';
};
};
windowsBoot = {
enable = mkEnableOption "Activation du démarrage de Windows par Grub";
drive = mkOption {

View File

@@ -13,7 +13,7 @@ mkIf flags.docker {
environment.systemPackages = with pkgs; [
# Ecosystème Docker
docker
python36Packages.docker_compose
docker-compose
];
virtualisation.docker.enable = true;

View File

@@ -48,9 +48,22 @@ mkIf flags.munin {
hosts = ''
[${config.networking.hostName}]
address 127.0.0.1
df._dev_sda2.warning 35
use_node_name yes
#contacts syslog
contacts email
'';
# http://sametmax.com/monitorez-vos-serveurs-avec-munin-et-notifications-par-email/
# http://guide.munin-monitoring.org/en/latest/tutorial/alert.html#syntax-of-warning-and-critical
extraGlobalConfig = ''
contact.email.command ${pkgs.mutt}/bin/mutt -F /etc/nixos/base/services/munin-muttrc -s "Munin notification for ''${var:host}" root@prunetwork.fr
#---
#contact.email.command ${pkgs.mutt}/bin/mutt -F /etc/nixos/base/services/munin-muttrc -s "Munin notification for ${config.networking.hostName}" root@ocean.prunetwork.fr
contact.email.command /run/current-system/sw/bin/mutt -F /etc/nixos/base/services/munin-muttrc -s "Munin notification for ${config.networking.hostName}" root@ocean.prunetwork.fr
contact.syslog.command /run/current-system/sw/bin/logger -p user.crit -t "Munin notification for ${config.networking.hostName}"
#---
contact.email.always_send ok,warning,critical,unknown
contact.syslog.always_send ok,warning,critical,unknown
'';
};

View File

@@ -18,9 +18,8 @@ mkIf flags.nixos-manual {
# Services
## documentation sur ctrl + alt + F8
services.nixosManual = {
documentation.nixos = {
enable = true;
showManual = true;
};
# Réseau

View File

@@ -11,11 +11,20 @@ mkIf flags.scanner {
# Paquets
environment.systemPackages = with pkgs; [
# Driver
hplip # Scanner HP
python27Packages.pyqt4 # dépendance hplip
# Outils pour exploiter les scanners
simple-scan
];
# Services
hardware.sane.enable = true;
services.saned = {
enable = true;
extraConfig = "192.168.0.0/24";
};
# Réseau
networking.firewall = {

View File

@@ -26,6 +26,9 @@ mkIf true {
# Use kernel sandbox mechanisms where possible in unprivilegied processes
# Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere.
UsePrivilegeSeparation sandbox
# Permet de gérer le nombre de connexions multiplexées en simultané
MaxSessions 200
'';
};
}

View File

@@ -33,7 +33,7 @@ mkIf true {
gnupg opensc pcsctools libu2f-host yubikey-personalization
];
security.pam.enableU2F = true;
security.pam.u2f.enable = true;
/*users.extraUsers.joko = {
isNormalUser = true;