From 18060e87db39341ec6d74cf157b51aaaae13093d Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 28 Jan 2025 00:28:06 +0100 Subject: [PATCH] style: giveing some order in this configuration --- flake.nix | 15 +-- .../fix/configuration.nix | 91 +------------------ .../fix/hardware-configuration.nix | 2 + hosts/global.nix | 85 +++++++++++++++++ 4 files changed, 97 insertions(+), 96 deletions(-) rename configuration.nix => hosts/fix/configuration.nix (67%) rename hardware-configuration.nix => hosts/fix/hardware-configuration.nix (97%) create mode 100644 hosts/global.nix diff --git a/flake.nix b/flake.nix index 090559a..8f632a1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,18 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils, ... }@inputs: - { - nixosConfigurations."nixos-fix" = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./configuration.nix ]; - }; + let + pkgs = import nixpkgs { + config.allowUnfree = true; }; + in { + nixosConfigurations."nixos-fix" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ ./hosts/fix/configuration.nix ]; + }; + }; } diff --git a/configuration.nix b/hosts/fix/configuration.nix similarity index 67% rename from configuration.nix rename to hosts/fix/configuration.nix index 2cf0687..a43a1cd 100644 --- a/configuration.nix +++ b/hosts/fix/configuration.nix @@ -2,6 +2,7 @@ { imports = [ + ../global.nix ./hardware-configuration.nix ]; @@ -18,53 +19,6 @@ wireless.enable = false; }; - documentation = { - enable = true; - man.enable = true; - dev.enable = true; - }; - - # Set your time zone. - time.timeZone = "Europe/Paris"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_US.UTF-8"; - 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"; - }; - }; - - users = { - defaultUserShell = pkgs.zsh; - users = { - raphael = { - isNormalUser = true; - description = "The main account of raphael"; - useDefaultShell = true; - extraGroups = [ - "networkmanager" - "dialout" - "plugdev" - "wheel" - "docker" - "video" - ]; - packages = with pkgs; [ - home-manager - ]; - }; - }; - }; - systemd.services = { ticket = { description = "Service for ticket"; @@ -124,55 +78,13 @@ }; }; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - nix.extraOptions = ''experimental-features = nix-command flakes''; - programs = { - zsh.enable = true; steam = { enable = true; gamescopeSession.enable = true; }; gamemode.enable = true; }; - - environment.systemPackages = with pkgs; [ - bat - cairo - dconf - fastfetch - git - go - home-manager - lego - libjpeg - libpng - libuuid - linux-manual - man - man-pages - man-pages-posix - networkmanager - nodejs - openssl - pkg-config - postgresql - protonup - python3 - python3Packages.pip - qflipper - tmux - unzip - wget - wl-clipboard - xclip - xsel - yarn - zsh - vim - ]; services = { openssh = { @@ -204,7 +116,6 @@ postgresql = { enable = true; }; - xserver.videoDrivers = ["nvidia"]; greetd = { enable = true; settings = { diff --git a/hardware-configuration.nix b/hosts/fix/hardware-configuration.nix similarity index 97% rename from hardware-configuration.nix rename to hosts/fix/hardware-configuration.nix index 02bec2a..9d5b5fd 100644 --- a/hardware-configuration.nix +++ b/hosts/fix/hardware-configuration.nix @@ -53,6 +53,8 @@ networking.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true; # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { open = false; diff --git a/hosts/global.nix b/hosts/global.nix new file mode 100644 index 0000000..89652d7 --- /dev/null +++ b/hosts/global.nix @@ -0,0 +1,85 @@ +{ config, pkgs, ... }: + +{ + documentation = { + enable = true; + man.enable = true; + dev.enable = true; + }; + time.timeZone = "Europe/Paris"; + i18n = { + defaultLocale = "en_US.UTF-8"; + 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"; + }; + }; + users = { + defaultUserShell = pkgs.zsh; + users = { + raphael = { + isNormalUser = true; + description = "The main account of raphael"; + useDefaultShell = true; + extraGroups = [ + "networkmanager" + "dialout" + "plugdev" + "wheel" + "docker" + "video" + ]; + packages = with pkgs; [ + home-manager + ]; + }; + }; + }; + nixpkgs.config.allowUnfree = true; + nix.extraOptions = ''experimental-features = nix-command flakes''; + programs = { + zsh.enable = true; + }; + environment.systemPackages = with pkgs; [ + bat + cairo + dconf + fastfetch + git + go + home-manager + lego + libjpeg + libpng + libuuid + linux-manual + man + man-pages + man-pages-posix + networkmanager + nodejs + openssl + pkg-config + postgresql + protonup + python3 + python3Packages.pip + qflipper + tmux + unzip + wget + wl-clipboard + xclip + xsel + yarn + zsh + vim + ]; +}