From a4d7f15e606688ac08dfe50e8f03bbce7b373f19 Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 16:21:17 +0200 Subject: [PATCH 01/16] add git --- nixos/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f612140..30648f3 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -87,7 +87,7 @@ environment.systemPackages = with pkgs; [ vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget - #openssh + git ]; # Some programs need SUID wrappers, can be configured further or are From a0dbcc0c2f24d18f946b66ea53a7b67f0012604b Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 16:42:41 +0200 Subject: [PATCH 02/16] move file to root --- nixos/configuration.nix => configuration.nix | 4 +--- .../hardware-configuration.nix => hardware-configuration.nix | 0 nixos/locals.nix => locals.nix | 0 3 files changed, 1 insertion(+), 3 deletions(-) rename nixos/configuration.nix => configuration.nix (96%) rename nixos/hardware-configuration.nix => hardware-configuration.nix (100%) rename nixos/locals.nix => locals.nix (100%) diff --git a/nixos/configuration.nix b/configuration.nix similarity index 96% rename from nixos/configuration.nix rename to configuration.nix index 30648f3..284199e 100644 --- a/nixos/configuration.nix +++ b/configuration.nix @@ -85,9 +85,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - git + vim wget git ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/nixos/hardware-configuration.nix b/hardware-configuration.nix similarity index 100% rename from nixos/hardware-configuration.nix rename to hardware-configuration.nix diff --git a/nixos/locals.nix b/locals.nix similarity index 100% rename from nixos/locals.nix rename to locals.nix From 9ca05c7c815767a08e6a7d3fb1e30ff18c87e292 Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 16:46:19 +0200 Subject: [PATCH 03/16] fix syntax --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 284199e..60d8333 100644 --- a/configuration.nix +++ b/configuration.nix @@ -104,7 +104,7 @@ ports = [ 22 ]; settings = { PasswordAuthentication = false; - AllowUsers = freenen; # Allows all users by default. Can be [ "user1" "user2" ] + AllowUsers = [ "freenen" ]; UseDns = true; X11Forwarding = false; PermitRootLogin = "no"; From 800d1807da71a056ac162d46650cce28a881640d Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 16:47:37 +0200 Subject: [PATCH 04/16] allow ssh pass auth --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 60d8333..b8c257a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -103,7 +103,7 @@ enable = true; ports = [ 22 ]; settings = { - PasswordAuthentication = false; + PasswordAuthentication = true; AllowUsers = [ "freenen" ]; UseDns = true; X11Forwarding = false; From 04c026aa26a8b640568757474033dfc5ad21d4ec Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 17:17:05 +0200 Subject: [PATCH 05/16] further spling and rremove gnome apps --- configuration.nix | 42 +++--------------------------------------- locals.nix | 6 ++++++ services.nix | 20 ++++++++++++++++++++ software.nix | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 services.nix create mode 100644 software.nix diff --git a/configuration.nix b/configuration.nix index b8c257a..68f082f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -9,6 +9,8 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ./locals.nix + ./services.nix + ./software.nix ]; # Bootloader. @@ -36,12 +38,7 @@ # Enable the GNOME Desktop Environment. services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; - - # Configure keymap in X11 - services.xserver = { - layout = "us"; - xkbVariant = "euro"; - }; + services.gnome.core-utilities.enable = false; # disable all extra apps from gnome # Enable CUPS to print documents. services.printing.enable = true; @@ -76,18 +73,6 @@ ]; }; - # Install firefox. - programs.firefox.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim wget git - ]; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; @@ -96,27 +81,6 @@ # enableSSHSupport = true; # }; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - ports = [ 22 ]; - settings = { - PasswordAuthentication = true; - AllowUsers = [ "freenen" ]; - UseDns = true; - X11Forwarding = false; - PermitRootLogin = "no"; - }; - }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ 22 ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # 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 diff --git a/locals.nix b/locals.nix index 1d2a9db..f30293a 100644 --- a/locals.nix +++ b/locals.nix @@ -1,4 +1,10 @@ { + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = "euro"; + }; + # Set your time zone. time.timeZone = "Europe/Amsterdam"; diff --git a/services.nix b/services.nix new file mode 100644 index 0000000..5d1d23c --- /dev/null +++ b/services.nix @@ -0,0 +1,20 @@ +{ + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PasswordAuthentication = true; + AllowUsers = [ "freenen" ]; + UseDns = true; + X11Forwarding = false; + PermitRootLogin = "no"; + }; + }; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ 22 ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; +} diff --git a/software.nix b/software.nix new file mode 100644 index 0000000..68235ea --- /dev/null +++ b/software.nix @@ -0,0 +1,18 @@ +{ + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim wget git + vscodium + ]; + + services.flatpak.enable = true; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + xdg.portal.config.common.default = "gtk"; +} From e3f5726784d0e9195f54d33d5a15f0ef3afb164d Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 17:20:25 +0200 Subject: [PATCH 06/16] include pkgs in software --- software.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/software.nix b/software.nix index 68235ea..41e6e82 100644 --- a/software.nix +++ b/software.nix @@ -1,3 +1,5 @@ +{ config, pkgs, ... }: + { # Install firefox. programs.firefox.enable = true; From d54a7adb050a3df29208429aa3eac4f91371820f Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 18:30:14 +0200 Subject: [PATCH 07/16] udpate flatpack config --- flake.nix | 15 +++++++++++++++ software.nix | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f8caed5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + inputs = { + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=0.4.1"; + }; + + outputs = { nix-flatpak, ... }: { + nixosConfigurations.frdesktop = nixpkgs.lib.nixosSystem { + modules = [ + nix-flatpak.nixosModules.nix-flatpak + + ./configuration.nix + ]; + }; + }; +} \ No newline at end of file diff --git a/software.nix b/software.nix index 41e6e82..a4fc6ee 100644 --- a/software.nix +++ b/software.nix @@ -12,9 +12,45 @@ environment.systemPackages = with pkgs; [ vim wget git vscodium + gnome.nautilus + libsForQt5.kalgebra ]; services.flatpak.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - xdg.portal.config.common.default = "gtk"; + xdg.portal = { + enable = true; + config.common.default = [ "gtk" ]; + extraPortals = with pkgs; [ + # xdg-desktop-portal-wlr + # xdg-desktop-portal-kde + xdg-desktop-portal-gtk + ]; + }; + services.flatpak.remotes = lib.mkOptionDefault [{ + name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; + }]; + + services.flatpak.packages = [ + "md.obsidian.Obsidian" + "org.mozilla.Thunderbird" + "com.discordapp.Discord" + "com.github.IsmaelMartinez.teams_for_linux" + "org.signal.Signal" + "org.telegram.desktop" + "com.github.tchx84.Flatseal" + "com.yubico.yubioath" + "org.filezillaproject.Filezilla" + "org.gnome.moserial" + "org.raspberrypi.rpi-imager" + "org.sdrangel.SDRangel" + "com.makemkv.MakeMKV" + "fr.handbrake.ghb" + "com.valvesoftware.Steam" + "com.mojang.Minecraft" + "org.inkscape.Inkscape" + "org.gnome.Rhythmbox3" + "com.prusa3d.PrusaSlicer" + "org.freecadweb.FreeCAD" + "org.kicad.KiCad" + ]; } From f572484fda087890b8df08d82e54c84ae709b949 Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 18:32:31 +0200 Subject: [PATCH 08/16] add nixpkgs to flakes --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index f8caed5..8b63b67 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ { inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=0.4.1"; }; From afeb6859923497b60f2e24f2b2dba1e0e364aa2c Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 18:33:31 +0200 Subject: [PATCH 09/16] actualy add it --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8b63b67..23ba8f6 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=0.4.1"; }; - outputs = { nix-flatpak, ... }: { + outputs = { nixpkgs, nix-flatpak, ... }: { nixosConfigurations.frdesktop = nixpkgs.lib.nixosSystem { modules = [ nix-flatpak.nixosModules.nix-flatpak From a7fa7771f673a53cacf2cbdd014cfe057a99fa0f Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 18:34:38 +0200 Subject: [PATCH 10/16] fix tag of nix-flatpak --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 23ba8f6..09d8af3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=0.4.1"; + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; }; outputs = { nixpkgs, nix-flatpak, ... }: { From 6799f1d6501d28efd25f61669c34eae36ca6003e Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 18:38:29 +0200 Subject: [PATCH 11/16] add lib to software --- software.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software.nix b/software.nix index a4fc6ee..c716a22 100644 --- a/software.nix +++ b/software.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { # Install firefox. From 16967e9ae217538d72cfc2bd1d5aafa04aae4d4a Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 19:01:48 +0200 Subject: [PATCH 12/16] remove xdg-desktop-portal-gtk. it apears te be included with gnome --- software.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/software.nix b/software.nix index c716a22..a5d37d7 100644 --- a/software.nix +++ b/software.nix @@ -20,11 +20,6 @@ xdg.portal = { enable = true; config.common.default = [ "gtk" ]; - extraPortals = with pkgs; [ - # xdg-desktop-portal-wlr - # xdg-desktop-portal-kde - xdg-desktop-portal-gtk - ]; }; services.flatpak.remotes = lib.mkOptionDefault [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; From ed1b61b87646524323c57de45bc327399958b6df Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 19:08:53 +0200 Subject: [PATCH 13/16] enable garbage collection --- configuration.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 68f082f..c3106a6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -81,6 +81,13 @@ # enableSSHSupport = true; # }; + # Automatic Garbage Collection + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + # 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 @@ -88,5 +95,4 @@ # 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 = "24.05"; # Did you read the comment? - } From 576662b7e180cbe9b138238adb7b2246cdef2c2d Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 20:13:26 +0200 Subject: [PATCH 14/16] add software and flatpak overrides --- software.nix | 111 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 6 deletions(-) diff --git a/software.nix b/software.nix index a5d37d7..78c6c6b 100644 --- a/software.nix +++ b/software.nix @@ -1,8 +1,4 @@ -{ config, pkgs, lib, ... }: - -{ - # Install firefox. - programs.firefox.enable = true; +{ config, pkgs, lib, ... }: { # Allow unfree packages nixpkgs.config.allowUnfree = true; @@ -10,10 +6,12 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - vim wget git + vim wget git ncdu btop + gcc cmake valgrind clang-tools vscodium gnome.nautilus libsForQt5.kalgebra + texliveFull ]; services.flatpak.enable = true; @@ -24,8 +22,13 @@ services.flatpak.remotes = lib.mkOptionDefault [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }]; + services.flatpak.update.auto = { + enable = true; + onCalendar = "weekly"; + }; services.flatpak.packages = [ + "org.mozilla.firefox" "md.obsidian.Obsidian" "org.mozilla.Thunderbird" "com.discordapp.Discord" @@ -35,6 +38,7 @@ "com.github.tchx84.Flatseal" "com.yubico.yubioath" "org.filezillaproject.Filezilla" + "com.nextcloud.desktopclient.nextcloud" "org.gnome.moserial" "org.raspberrypi.rpi-imager" "org.sdrangel.SDRangel" @@ -42,10 +46,105 @@ "fr.handbrake.ghb" "com.valvesoftware.Steam" "com.mojang.Minecraft" + "org.gimp.GIMP" "org.inkscape.Inkscape" + "org.videolan.VLC" "org.gnome.Rhythmbox3" + "org.audacityteam.Audacity" "com.prusa3d.PrusaSlicer" "org.freecadweb.FreeCAD" "org.kicad.KiCad" ]; + services.flatpak.overrides = { + global = { + # Force Wayland by default + Context.sockets = [ + "wayland" "!x11" "!fallback-x11" + ]; + filesystems = [ + "!home" + ]; + Environment = { + XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; # Fix un-themed cursor in some Wayland apps + GTK_THEME = "Adwaita:dark"; # Force correct theme for some GTK apps + }; + }; + + "md.obsidian.Obsidian".Context = { + filesystems = [ + "~/.ssh:ro" + "xdg-config/git:ro" + "~/git/kladjes:rw" + "!/run/media" "!/media" "!/mnt" + ]; + }; + + "org.filezillaproject.Filezilla".Context = { + filesystems = [ + "!host" + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "com.nextcloud.desktopclient.nextcloud".Context = { + filesystems = [ + "!host" + "~/datatjes:rw" + ]; + }; + + "org.gimp.GIMP".Context = { + filesystems = [ + "!host" + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "org.inkscape.Inkscape".Context = { + filesystems = [ + "!host" + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "org.videolan.VLC".Context = { + filesystems = [ + "!host" + "xdg-videos" + ]; + }; + + "org.audacityteam.Audacity".Context = { + filesystems = [ + "!host" + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "com.prusa3d.PrusaSlicer".Context = { + filesystems = [ + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "org.freecadweb.FreeCAD".Context = { + filesystems = [ + "!host" + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + + "org.kicad.KiCad".Context = { + filesystems = [ + "xdg-documents:rw" + "xdg-downloads:rw" + ]; + }; + }; } From 1eff0d29ae9ec7d3dcbd7fb8f6471e7c57dfdcce Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 20:19:58 +0200 Subject: [PATCH 15/16] update flatpack overrides --- software.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/software.nix b/software.nix index 78c6c6b..984e911 100644 --- a/software.nix +++ b/software.nix @@ -62,6 +62,7 @@ "wayland" "!x11" "!fallback-x11" ]; filesystems = [ + "!host" "!home" ]; Environment = { @@ -81,7 +82,6 @@ "org.filezillaproject.Filezilla".Context = { filesystems = [ - "!host" "xdg-documents:rw" "xdg-downloads:rw" ]; @@ -89,14 +89,12 @@ "com.nextcloud.desktopclient.nextcloud".Context = { filesystems = [ - "!host" "~/datatjes:rw" ]; }; "org.gimp.GIMP".Context = { filesystems = [ - "!host" "xdg-documents:rw" "xdg-downloads:rw" ]; @@ -104,7 +102,6 @@ "org.inkscape.Inkscape".Context = { filesystems = [ - "!host" "xdg-documents:rw" "xdg-downloads:rw" ]; @@ -112,14 +109,12 @@ "org.videolan.VLC".Context = { filesystems = [ - "!host" "xdg-videos" ]; }; "org.audacityteam.Audacity".Context = { filesystems = [ - "!host" "xdg-documents:rw" "xdg-downloads:rw" ]; @@ -134,7 +129,6 @@ "org.freecadweb.FreeCAD".Context = { filesystems = [ - "!host" "xdg-documents:rw" "xdg-downloads:rw" ]; From e7b56b19b5f6fa14f45fec77b8a7cd7a2617995d Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 26 Apr 2024 20:25:12 +0200 Subject: [PATCH 16/16] fix flatpak overrides global filesystems --- software.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software.nix b/software.nix index 984e911..c199776 100644 --- a/software.nix +++ b/software.nix @@ -61,7 +61,7 @@ Context.sockets = [ "wayland" "!x11" "!fallback-x11" ]; - filesystems = [ + Context.filesystems = [ "!host" "!home" ];