summaryrefslogtreecommitdiff
path: root/nixos.org
diff options
context:
space:
mode:
Diffstat (limited to 'nixos.org')
-rw-r--r--nixos.org198
1 files changed, 99 insertions, 99 deletions
diff --git a/nixos.org b/nixos.org
index b1850d0..5243f1b 100644
--- a/nixos.org
+++ b/nixos.org
@@ -16,7 +16,7 @@ stuff
in
{
imports = [
- <<nixos-config>>
+ <<nixos-config>>
];
}
#+end_src
@@ -32,8 +32,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
@@ -53,10 +53,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
@@ -75,10 +75,10 @@ stuff
nix.package = pkgs.nixFlakes;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
- (final: prev: {
- emacs = (import sources.emacs-ng).outputs.defaultPackage."x86_64-linux";
- emacsWithPackages = final.emacs.pkgs.withPackages;
- })
+ (final: prev: {
+ emacs = (import sources.emacs-ng).outputs.defaultPackage."x86_64-linux";
+ emacsWithPackages = final.emacs.pkgs.withPackages;
+ })
];
}
#+end_src
@@ -87,28 +87,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
@@ -119,49 +119,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
@@ -170,28 +170,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
@@ -206,44 +206,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