From feb4e190ff8893022f2fb7fd6032e0e7e95810d1 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sun, 15 Sep 2024 21:48:47 +0300 Subject: [PATCH 1/3] Convert nix setup to flakes --- flake.lock | 27 +++++++++++++++++++ flake.nix | 17 ++++++++++++ .../Mirkwood/configuration.nix | 10 +------ .../Mirkwood/hardware-configuration.nix | 0 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 flake.lock rename configuration.nix => hosts/Mirkwood/configuration.nix (92%) rename hardware-configuration.nix => hosts/Mirkwood/hardware-configuration.nix (100%) diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..7f382f67 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1726320982, + "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index e69de29b..4d9ee849 100644 --- a/flake.nix +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + description = "FunctionalHacker's NixOS config"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + }; + + outputs = { self, nixpkgs, ...}@inputs: { + nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/Mirkwood/configuration.nix + ./gpg.nix + ]; + }; + }; +} diff --git a/configuration.nix b/hosts/Mirkwood/configuration.nix similarity index 92% rename from configuration.nix rename to hosts/Mirkwood/configuration.nix index 8a12708d..c0819abe 100644 --- a/configuration.nix +++ b/hosts/Mirkwood/configuration.nix @@ -1,15 +1,7 @@ -# 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. - ./hardware-configuration.nix - ./gpg.nix - ]; + imports = [ ./hardware-configuration.nix ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hardware-configuration.nix b/hosts/Mirkwood/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/Mirkwood/hardware-configuration.nix From f5683f9712f7f3a1c75d04abb921f698706bbdd9 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sun, 15 Sep 2024 22:00:33 +0300 Subject: [PATCH 2/3] Clean up some unneeded stuff in nix config --- hosts/Mirkwood/configuration.nix | 49 +------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/hosts/Mirkwood/configuration.nix b/hosts/Mirkwood/configuration.nix index c0819abe..2d8f992c 100644 --- a/hosts/Mirkwood/configuration.nix +++ b/hosts/Mirkwood/configuration.nix @@ -13,10 +13,6 @@ networking.hostName = "Mirkwood"; # Define your hostname. networking.wireless.iwd.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.networkmanager.wifi.backend = "iwd"; @@ -52,9 +48,6 @@ variant = ""; }; - # Enable CUPS to print documents. - services.printing.enable = true; - # Enable sound with pipewire. hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -63,18 +56,8 @@ 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 is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; }; - # 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.functionalhacker = { isNormalUser = true; description = "Marko Korhonen"; @@ -87,9 +70,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; [ @@ -100,33 +80,6 @@ usbutils wl-clipboard git + pass ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # 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 - # 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 = "24.05"; # Did you read the comment? - } From 6a7ed1deaa37b832d895722ef290257683b3b4e2 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sun, 15 Sep 2024 22:16:45 +0300 Subject: [PATCH 3/3] Add browserpass --- hosts/Mirkwood/configuration.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hosts/Mirkwood/configuration.nix b/hosts/Mirkwood/configuration.nix index 2d8f992c..d21adb40 100644 --- a/hosts/Mirkwood/configuration.nix +++ b/hosts/Mirkwood/configuration.nix @@ -68,7 +68,10 @@ }; # Install firefox. - programs.firefox.enable = true; + programs.firefox = { + enable = true; + nativeMessagingHosts.packages = with pkgs; [ browserpass ]; + }; # List packages installed in system profile. To search, run: # $ nix search wget @@ -81,5 +84,6 @@ wl-clipboard git pass + gnumake ]; }