summary refs log tree commit diff
path: root/nixos.org
diff options
context:
space:
mode:
authorCrazazy2022-02-13 18:09:48 +0100
committerCrazazy2022-02-16 15:33:10 +0100
commit7965b0987aec49c7316c081ffd7fe1b9d7e8ec1f (patch)
tree714f12456dc5064530c1ba266aed424b4c393995 /nixos.org
parent31cbfa1565380d80dae9baeabb04d9abcd9690f2 (diff)
re-formatted a lot of source code
Diffstat (limited to 'nixos.org')
-rw-r--r--nixos.org196
1 files changed, 98 insertions, 98 deletions
diff --git a/nixos.org b/nixos.org
index 4d748b4..1255858 100644
--- a/nixos.org
+++ b/nixos.org
@@ -22,7 +22,7 @@ stuff
     in
     {
       imports = [
-        <<nixos-config>>
+	<<nixos-config>>
       ];
     }
   #+end_src
@@ -38,8 +38,8 @@ stuff
    #+begin_src nix :noweb-ref nixos-config :tangle no
      {
        options.mainUser = with lib; mkOption {
-         type = types.str;
-         default = builtins.getEnv "USER";
+	 type = types.str;
+	 default = builtins.getEnv "USER";
        };
      }
    #+end_src
@@ -59,10 +59,10 @@ stuff
        users.mutableUsers = false;
        # Define a user account. Don't forget to set a password with ‘passwd’.
        users.users.${config.mainUser} = {
-         initialHashedPassword = "$6$XTH/sALyqg$G.bMWemErh4KGCAjUfT16DL96QMn/4NTmxlw6Z26wUVJn.tagQG.Fzmrz7uPkdiWZbBBFWP36.YA4hw9AcL8Q1";
-         isNormalUser = true;
-         extraGroups = [ "video" "wheel" "NetworkManager" ]; # Enable ‘sudo’ for the user.
-         # shell = pkgs.nushell;
+	 initialHashedPassword = "$6$XTH/sALyqg$G.bMWemErh4KGCAjUfT16DL96QMn/4NTmxlw6Z26wUVJn.tagQG.Fzmrz7uPkdiWZbBBFWP36.YA4hw9AcL8Q1";
+	 isNormalUser = true;
+	 extraGroups = [ "video" "wheel" "NetworkManager" ]; # Enable ‘sudo’ for the user.
+	 # shell = pkgs.nushell;
        };
      }
    #+end_src
@@ -81,9 +81,9 @@ stuff
        nix.package = pkgs.nixFlakes;
        nixpkgs.config.allowUnfree = true;
        nixpkgs.overlays = [
-         (final: prev: {
-           emacs = sources.emacs-ng.outputs.defaultPackage."x86_64-linux";
-         })
+	 (final: prev: {
+	   emacs = (import sources.emacs-ng).outputs.defaultPackage."x86_64-linux";
+	 })
        ];
      }
    #+end_src
@@ -92,28 +92,28 @@ stuff
     We will create a small module for cachix before we put in the rest declaratively
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        options.nix.cacheAttrs = with lib; mkOption {
-          type = with types; attrsOf str;
-          default = {};
+	options.nix.cacheAttrs = with lib; mkOption {
+	  type = with types; attrsOf str;
+	  default = {};
 
-        };
-        config = with lib; {
-          nix.binaryCaches = builtins.attrNames config.nix.cacheAttrs;
-          nix.binaryCachePublicKeys = builtins.attrValues config.nix.cacheAttrs;
-        };
+	};
+	config = with lib; {
+	  nix.binaryCaches = builtins.attrNames config.nix.cacheAttrs;
+	  nix.binaryCachePublicKeys = builtins.attrValues config.nix.cacheAttrs;
+	};
       }
     #+end_src
     With the config in hand, we can now quickly and easily declare our substitute servers
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        nix.cacheAttrs = {
-          "https://crazazy.cachix.org" = "crazazy.cachix.org-1:3KaIHK26pkvd5palJH5A4Re1Hn2+GDV+aXYnftMYAm4=";
-          "https://emacsng.cachix.org" = "emacsng.cachix.org-1:i7wOr4YpdRpWWtShI8bT6V7lOTnPeI7Ho6HaZegFWMI=";
-          "https://ethancedwards8.cachix.org" = "ethancedwards8.cachix.org-1:YMasjqyFnDreRQ9GXmnPIshT3tYyFHE2lUiNhbyIxOc=";
-          "https://nix-community.cachix.org" = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
-          "https://nrdxp.cachix.org" = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4=";
-          "https://rycee.cachix.org" = "rycee.cachix.org-1:TiiXyeSk0iRlzlys4c7HiXLkP3idRf20oQ/roEUAh/A=";
-        };
+	nix.cacheAttrs = {
+	  "https://crazazy.cachix.org" = "crazazy.cachix.org-1:3KaIHK26pkvd5palJH5A4Re1Hn2+GDV+aXYnftMYAm4=";
+	  "https://emacsng.cachix.org" = "emacsng.cachix.org-1:i7wOr4YpdRpWWtShI8bT6V7lOTnPeI7Ho6HaZegFWMI=";
+	  "https://ethancedwards8.cachix.org" = "ethancedwards8.cachix.org-1:YMasjqyFnDreRQ9GXmnPIshT3tYyFHE2lUiNhbyIxOc=";
+	  "https://nix-community.cachix.org" = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
+	  "https://nrdxp.cachix.org" = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4=";
+	  "https://rycee.cachix.org" = "rycee.cachix.org-1:TiiXyeSk0iRlzlys4c7HiXLkP3idRf20oQ/roEUAh/A=";
+	};
       }
     #+end_src
 ** udev binds
@@ -124,49 +124,49 @@ stuff
     generated temporary directories to the owner of the home folder
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        options = with lib; {
-          homeBinds = mkOption {
-            type = with types; listOf str;
-            default = [ ];
-            description = "Bind mounts in your home folder";
-          };
-          persistRoot = mkOption {
-            type = types.str;
-            default = "/nix/persist";
-          };
-        };
-        config = with lib; mkIf (config.homeBinds != [ ]) {
-          fileSystems = genAttrs (map (loc: "/home/${config.mainUser}/${loc}") config.homeBinds)
-            (loc: {
-              device = "${config.persistRoot}${loc}";
-              fsType = "none";
-              options = [ "bind" ];
-            });
-          systemd.services.fix-home-perms = {
-            wantedBy = [ "multi-user.target" ];
-            after = map (loc: "${builtins.replaceStrings ["/"] ["-"] loc}.mount") config.homeBinds;
-            serviceConfig.Type = "oneshot";
-            script = "chown -R ${config.mainUser} /home/${config.mainUser}";
-          };
-        };
+	options = with lib; {
+	  homeBinds = mkOption {
+	    type = with types; listOf str;
+	    default = [ ];
+	    description = "Bind mounts in your home folder";
+	  };
+	  persistRoot = mkOption {
+	    type = types.str;
+	    default = "/nix/persist";
+	  };
+	};
+	config = with lib; mkIf (config.homeBinds != [ ]) {
+	  fileSystems = genAttrs (map (loc: "/home/${config.mainUser}/${loc}") config.homeBinds)
+	    (loc: {
+	      device = "${config.persistRoot}${loc}";
+	      fsType = "none";
+	      options = [ "bind" ];
+	    });
+	  systemd.services.fix-home-perms = {
+	    wantedBy = [ "multi-user.target" ];
+	    after = map (loc: "${builtins.replaceStrings ["/"] ["-"] loc}.mount") config.homeBinds;
+	    serviceConfig.Type = "oneshot";
+	    script = "chown -R ${config.mainUser} /home/${config.mainUser}";
+	  };
+	};
       }
     #+end_src
 *** The binds
     These are the binds themselves, they change frequently
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        homeBinds = [
-          ".config/keybase"
-          ".local/share/Steam"
-          ".local/share/keybase"
-          ".mozilla/seamonkey"
-          ".ssh"
-          ".wine"
-          "Desktop"
-          "Documents"
-          "Music"
-          "Videos"
-        ];
+	homeBinds = [
+	  ".config/keybase"
+	  ".local/share/Steam"
+	  ".local/share/keybase"
+	  ".mozilla/seamonkey"
+	  ".ssh"
+	  ".wine"
+	  "Desktop"
+	  "Documents"
+	  "Music"
+	  "Videos"
+	];
       }
     #+end_src
 ** Visual stuff
@@ -175,28 +175,28 @@ stuff
     Enable printing, sound and a good keyboard, along with x11 itself
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        # Enable CUPS to print documents.
-        services.printing.enable = true;
+	# Enable CUPS to print documents.
+	services.printing.enable = true;
 
-        # Enable sound.
-        sound.enable = true;
-        hardware.pulseaudio.enable = true;
+	# Enable sound.
+	sound.enable = true;
+	hardware.pulseaudio.enable = true;
 
-        # Enable the X11 windowing system.
-        services.xserver.enable = true;
-        services.xserver.layout = "us";
-        services.xserver.xkbVariant = "altgr-intl";
-        services.xserver.xkbOptions = "eurosign:e";
-        # touchpad controls
-        services.xserver.libinput.enable = true;
+	# Enable the X11 windowing system.
+	services.xserver.enable = true;
+	services.xserver.layout = "us";
+	services.xserver.xkbVariant = "altgr-intl";
+	services.xserver.xkbOptions = "eurosign:e";
+	# touchpad controls
+	services.xserver.libinput.enable = true;
       }
     #+end_src
 *** XFCE
     I have decided to be lazy and not install a fancy window manager or whatever into the system. Thats headache
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        services.xserver.displayManager.lightdm.enable = true;
-        services.xserver.desktopManager.xfce.enable = true;
+	services.xserver.displayManager.lightdm.enable = true;
+	services.xserver.desktopManager.xfce.enable = true;
       }
     #+end_src
 ** Networking
@@ -214,44 +214,44 @@ stuff
     These are the normal packages that I use for core maintenance
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        environment.systemPackages = with pkgs; [
-          gitFull
-          curl
-          vim
-          nur.repos.crazazy.seamonkey
-          (wine.override { wineBuild = "wineWow"; })
-        ];
+	environment.systemPackages = with pkgs; [
+	  gitFull
+	  curl
+	  vim
+	  nur.repos.crazazy.seamonkey
+	  (wine.override { wineBuild = "wineWow"; })
+	];
       }
     #+end_src
 *** Steam
     I like to play videogames sometimes, however steam also requires a little more special attention
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        imports = [
-          nurModules.repos.crazazy.modules.private.steam-config
-        ];
-        environment.systemPackages = with pkgs; [
-          steam
-        ];
+	imports = [
+	  nurModules.repos.crazazy.modules.private.steam-config
+	];
+	environment.systemPackages = with pkgs; [
+	  steam
+	];
       }
     #+end_src
 *** Emacs
     Emacs needs to be integrated into the rest of the system. We are going to do that via a emacs daemon
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        services.emacs = {
-          # package = import ./emacs.nix;
-          enable = true;
-        };
-        homebinds = [
-          ".config/emacs"
-        ];
+	services.emacs = {
+	  package = import ./emacs.nix;
+	  enable = true;
+	};
+	homeBinds = [
+	  ".config/emacs"
+	];
       }
     #+end_src
 *** QEMU & frens
     I also sometimes run qemu vms. The qemu's manager will be libvirtd, but not sure if I will even use that
     #+begin_src nix :noweb-ref nixos-config :tangle no
       {
-        virtualisation.libvirtd.enable = true;
+	virtualisation.libvirtd.enable = true;
       }
     #+end_src