Config_nix_Thatoo/configuration.nix

184 lines
5.7 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help').
{ config, pkgs, lib, inputs, ... }:
{
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "ThinkPadT470"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
networking.hosts = {
# cloud de Défis
#"109.190.223.134" = ["cloud.defis.info"];
# yunohost
#"192.168.1.42" = ["maisondupecheur.leprette.fr"];
#"192.168.1.93" = ["pve.leprette.fr"];
#"192.168.1.50" = ["leprette.fr"];
#"192.168.1.45" = ["lestoitspartages.fr"];
#"192.168.1.55" = ["pve.hamdel.in"];
#"192.168.1.121" = ["hamdel.in"];
#"10.0.242.1" = ["hamdel.in"];
#"10.0.242.1" = ["maisondupecheur.leprette.fr"];
#"192.168.1.158" = ["zyuno.local"];
"192.168.122.183" = ["zyuno.local dokos.zyuno.local dokos.local nc.zyuno.local db.zyuno.local"];
#"10.0.242.100" = ["zyuno.local dokos.local"];
#"192.168.1.50" = ["pve.accolades.coop pbs.accolades.coop"];
#"192.168.1.27" = ["accolades.coop ynh.accolades.coop nc.accolades.coop db.accolades.coop matrix.accolades.coop"];
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 80 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
programs.ssh = {
startAgent = true;
enableAskPassword = true;
};
# Set your time zone.
time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "fr_FR.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
# Configure keymap in X11
services.xserver = {
xkb.layout = "fr";
xkb.variant = "";
xkb.extraLayouts = {
};
};
# Configure console keymap
console.keyMap = "fr";
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this i>
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing.drivers = [
pkgs.cnijfilter2
];
# nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
# "cnijfilter2"
# ];
hardware.sane.enable = true; # enables support for SANE scanners
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.thatoo = {
isNormalUser = true;
description = "Thatoo";
# wheel is group to gain sudo privileges, lp is group to access scanner that are also printer
extraGroups = [ "networkmanager" "wheel" "scanner" "lp" "nginx" "libvirtd" "mysql" ];
packages = with pkgs; [
];
};
# Auto system update
system.autoUpgrade = {
enable = false;
# enable = true;
flake = inputs.self.outPath;
flags = [
"--update-input"
"nixos-cosmic"
"--print-build-logs"
];
dates = "07:00";
randomizedDelaySec = "45min";
# allowReboot = true;
};
systemd.services.nixos-upgrade = {
serviceConfig = {
ExecStartPre = "/run/wrappers/bin/sudo -u thatoo ${pkgs.writeShellApplication {
name = "notify-upgrade";
runtimeInputs = with pkgs; [ libnotify ];
text = ''
export DISPLAY=${"\$"}{DISPLAY:=":0"}
export XDG_RUNTIME_DIR=${"\$"}{XDG_RUNTIME_DIR:=/run/user/$(id -u)}
export DBUS_SESSION_BUS_ADDRESS=${"\$"}{DBUS_SESSION_BUS_ADDRESS:="unix:path=${"\$"}{XDG_RUNTIME_DIR}/bus"}
notify-send --urgency=critical "Mise à jour de NixOS"
notify-send --urgency=critical --expire-time 60000 "Mise à jour de NixOS dans 1 minute"
sleep 1m
'';
}
}/bin/notify-upgrade";
};
};
# Automatic nix optimisation
# nix.optimise.automatic = true;
# Automatic Garbage Collection
# nix.gc = {
# automatic = true;
# dates = "weekly";
# options = "--delete-older-than 15d";
# };
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}