From 65749a4d893d2a982e1aa9cc462e6aa728e69bb4 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Mon, 21 Jun 2021 13:27:42 +0200 Subject: [PATCH] nixos cfg --- nixos/configuration.nix | 66 +++++++++++++++++++++++++++++++++++++++++ nixos/home.nix | 9 ++++++ nixos/localcfg.nix | 60 +++++++++++++++++++++++++++++++++++++ nixos/pkg.nix | 44 +++++++++++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 nixos/configuration.nix create mode 100644 nixos/home.nix create mode 100644 nixos/localcfg.nix create mode 100644 nixos/pkg.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..09e7bce --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,66 @@ +# 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, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + /etc/nixos/hardware-configuration.nix + ./pkg.nix + ./home.nix + ./localcfg.nix + ]; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "dvorak-programmer"; + }; + + security.rtkit.enable = true; + services = { + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + localtime.enable = true; + fwupd.enable = true; + }; + + environment.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + XDG_CURRENT_DESKTOP = "sway"; + }; + + fonts.enableDefaultFonts = true; + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "Hack" ]; }) + ]; + + networking.networkmanager.enable = true; + + nix.autoOptimiseStore = true; + nix.gc = { + automatic = true; + options = "--delete-older-than 7d"; # Ajuste comme tu veux, tu peux utiliser +5 pour garder les 5 dernières, etc. + }; + + # 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. It‘s 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 = "21.05"; # Did you read the comment? +} diff --git a/nixos/home.nix b/nixos/home.nix new file mode 100644 index 0000000..c0043ec --- /dev/null +++ b/nixos/home.nix @@ -0,0 +1,9 @@ +{...}: + +{ + imports = [ + + ]; + home-manager.useGlobalPkgs = true; + home-manager.users.traxys = (import /etc/nixos/traxys/home.nix); +} diff --git a/nixos/localcfg.nix b/nixos/localcfg.nix new file mode 100644 index 0000000..453dcba --- /dev/null +++ b/nixos/localcfg.nix @@ -0,0 +1,60 @@ +{ config, pkgs, ... }: + +{ + boot = { + initrd = { + luks.devices = { + root = { + device = "/dev/disk/by-uuid/de0242ac-788a-44fc-a1ef-8d7bfaa448c6"; + preLVM = true; + #keyFile = "/etc/secrets/initrd/keyfile"; + fallbackToPassword = true; + }; + home = { + device = "/dev/disk/by-uuid/b028c674-64c5-40e0-88c4-481d78854049"; + preLVM = true; + #keyFile = "/etc/secrets/initrd/keyfile"; + fallbackToPassword = true; + }; + }; + secrets = { + "/etc/secrets/initrd/keyfile" = "/etc/secrets/initrd/keyfile"; + }; + #kernelParams = [ "iomem=relaxed" ]; + }; + loader = { + grub = { + enable = true; + version = 2; + device = "nodev"; + enableCryptodisk = true; + }; + }; + }; + + networking = { + hostName = "ZeNixLaptop"; + interfaces = { + eno0.useDHCP = true; + wlp1s0.useDHCP = true; + }; + }; + + users.users.traxys = { + uid = 1000; + isNormalUser = true; + home = "/home/traxys"; + extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.zsh; + }; + + # Set your time zone. + time.timeZone = "Europe/Paris"; + + hardware.opengl = { + enable = true; + }; +} + + + diff --git a/nixos/pkg.nix b/nixos/pkg.nix new file mode 100644 index 0000000..7b1fddf --- /dev/null +++ b/nixos/pkg.nix @@ -0,0 +1,44 @@ +{ config, pkgs, ... }: + +{ + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + gtkUsePortal = true; + }; + }; + + nixpkgs.config = { + package = pkgs.nixFlakes; + allowUnfree = true; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + nixpkgs.overlays = [ + (import (builtins.fetchTarball { + url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz; + })) + ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + wget + neovim-nightly + git + gnumake + ripgrep + flashrom + gcc + libappindicator + file + jq + ]; +} +