From 0df93e912e8644f2a93be0119296dbcb5ae06093 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 17 Jan 2023 15:49:32 +0100 Subject: Add zfs, unify home manager --- nixos/common.nix | 5 +++++ nixos/gnome.nix | 1 + nixos/kde.nix | 2 +- nixos/lindy.nix | 22 +++++++++++++++++++++- nixpkgs/Makefile | 4 ++-- nixpkgs/common.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ nixpkgs/home.nix | 49 ------------------------------------------------- nixpkgs/kusanagi.nix | 9 +++++++++ nixpkgs/lindy.nix | 7 +++++++ 9 files changed, 92 insertions(+), 53 deletions(-) create mode 100644 nixpkgs/common.nix delete mode 100644 nixpkgs/home.nix create mode 100644 nixpkgs/kusanagi.nix create mode 100644 nixpkgs/lindy.nix diff --git a/nixos/common.nix b/nixos/common.nix index c736938..cfbc160 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: { + boot.supportedFilesystems = [ "ntfs" ]; + networking.networkmanager.enable = true; time.timeZone = "Europe/Paris"; @@ -106,6 +108,9 @@ spotify jellyfin-media-player nheko + gimp + inkscape + krita ]; programs.vim.defaultEditor = true; diff --git a/nixos/gnome.nix b/nixos/gnome.nix index 9d02459..fb78226 100644 --- a/nixos/gnome.nix +++ b/nixos/gnome.nix @@ -27,5 +27,6 @@ gnomeExtensions.appindicator gnomeExtensions.dash-to-panel gnome.gnome-terminal + libreoffice ]; } diff --git a/nixos/kde.nix b/nixos/kde.nix index 653a8eb..8ca19bb 100644 --- a/nixos/kde.nix +++ b/nixos/kde.nix @@ -2,5 +2,5 @@ services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; - environment.systemPackages = with pkgs.libsForQt5; [ kgpg ark ]; + environment.systemPackages = with pkgs.libsForQt5; [ kgpg ark pkgs.libreoffice-qt ]; } diff --git a/nixos/lindy.nix b/nixos/lindy.nix index 04ba248..bcc662e 100644 --- a/nixos/lindy.nix +++ b/nixos/lindy.nix @@ -12,6 +12,16 @@ ]; networking.hostName = "lindy"; + networking.hostId = "00000000"; + + # ZFS config + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + boot.supportedFilesystems = [ "zfs" ]; + boot.zfs.devNodes = "/dev/mapper"; + boot.zfs.extraPools = [ "Zonz" ]; + services.zfs.autoScrub.enable = true; + services.zfs.autoScrub.pools = [ "Zonz" ]; + environment.systemPackages = [ pkgs.zfs ]; # Use Grub boot.loader.grub.enable = true; @@ -19,7 +29,6 @@ boot.loader.grub.extraGrubInstallArgs = [ "--bootloader-id=NixOS" ]; boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.loader.efi.canTouchEfiVariables = true; - boot.plymouth.enable = true; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" ]; @@ -34,19 +43,30 @@ }; }; + environment.etc.crypttab = { + enable = true; + text = '' +Kurisu UUID=f593d307-66cc-4586-a899-f1ca20d74430 /root/kurisu_key +Kogami UUID=61534c91-df18-4c71-9244-54e677f5d4fa /root/kogami_key + ''; + }; + fileSystems."/" = { device = "/dev/disk/by-uuid/2e64e6fc-ab7c-4620-b56b-faee641bd2a6"; fsType = "ext4"; + options = [ "discard" ]; }; fileSystems."/home" = { device = "/dev/disk/by-uuid/1ef4b6f4-975d-4e04-9d88-0640e83ed0b4"; fsType = "ext4"; + options = [ "discard" ]; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/0728e7e5-8e21-44bd-9287-eb066d489a0e"; fsType = "ext4"; + options = [ "discard" ]; }; fileSystems."/boot/efi" = { diff --git a/nixpkgs/Makefile b/nixpkgs/Makefile index e99f6c2..4b3becf 100644 --- a/nixpkgs/Makefile +++ b/nixpkgs/Makefile @@ -1,3 +1,3 @@ all: - nixfmt home.nix - home-manager switch -f home.nix + nixfmt `hostname`.nix + home-manager switch -f `hostname`.nix diff --git a/nixpkgs/common.nix b/nixpkgs/common.nix new file mode 100644 index 0000000..7ecdb89 --- /dev/null +++ b/nixpkgs/common.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: { + home.username = "lx"; + + programs.bash = { + enable = true; + shellAliases = { + ll = "ls -lah"; + irc = "ssh -t adnab.me /usr/local/bin/irc"; + }; + }; + programs.keychain = { + enable = true; + enableBashIntegration = true; + keys = [ "~/.ssh/id_ed25519" ]; + }; + programs.vim = { + enable = true; + extraConfig = (builtins.readFile ../vim/vimrc); + plugins = with pkgs.vimPlugins; [ vim-nix fzf-vim nerdtree ]; + }; + + programs.git.enable = true; + programs.git.userName = "Alex Auvolat"; + programs.git.userEmail = "alex@adnab.me"; + + home.file = { ".config/tmux/tmux.conf".source = ../tmux/tmux.conf; }; + + xsession.enable = true; + + xdg.enable = true; + xdg.userDirs = { + desktop = null; + documents = null; + pictures = null; + music = null; + publicShare = null; + templates = null; + videos = null; + }; + + services.syncthing.enable = true; + + nixpkgs.config.allowUnfree = true; + + home.stateVersion = "22.11"; +} diff --git a/nixpkgs/home.nix b/nixpkgs/home.nix deleted file mode 100644 index ae8bc5d..0000000 --- a/nixpkgs/home.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ pkgs, ... }: { - home.username = "lx"; - home.homeDirectory = "/home/lx"; - - programs.bash = { - enable = true; - shellAliases = { - ll = "ls -lah"; - irc = "ssh -t adnab.me /usr/local/bin/irc"; - }; - }; - programs.keychain = { - enable = true; - enableBashIntegration = true; - keys = [ "/home/lx/.ssh/id_ed25519" ]; - }; - programs.vim = { - enable = true; - extraConfig = (builtins.readFile ../vim/vimrc); - plugins = with pkgs.vimPlugins; [ vim-nix fzf-vim nerdtree ]; - }; - - programs.git.enable = true; - programs.git.userName = "Alex Auvolat"; - programs.git.userEmail = "alex@adnab.me"; - - home.file = { ".config/tmux/tmux.conf".source = ../tmux/tmux.conf; }; - - xsession.enable = true; - - xdg.enable = true; - xdg.userDirs = { - download = "/home/lx/Downloads"; - desktop = null; - documents = null; - pictures = null; - music = null; - publicShare = null; - templates = null; - videos = null; - }; - - services.syncthing.enable = true; - - nixpkgs.config.allowUnfree = true; - - home.stateVersion = "22.11"; -} - diff --git a/nixpkgs/kusanagi.nix b/nixpkgs/kusanagi.nix new file mode 100644 index 0000000..6757886 --- /dev/null +++ b/nixpkgs/kusanagi.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + imports = [ + ./common.nix + ]; + + home.homeDirectory = "/home/lx"; + xdg.userDirs.download = "/home/lx/Downloads"; +} + diff --git a/nixpkgs/lindy.nix b/nixpkgs/lindy.nix new file mode 100644 index 0000000..1dbc65f --- /dev/null +++ b/nixpkgs/lindy.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + imports = [ ./common.nix ]; + + home.homeDirectory = "/home/lx.nix"; + xdg.userDirs.download = "/home/lx.nix/Downloads"; +} + -- cgit v1.2.3