diff options
author | Emma@Rory <root@rory.gay> | 2023-08-23 00:48:28 +0200 |
---|---|---|
committer | Emma@Rory <root@rory.gay> | 2023-08-23 00:48:28 +0200 |
commit | 29c9eeeb228dbe62160d176d9dc72521ec225332 (patch) | |
tree | eab008e7b2a7beedded88dcd8eecb8722284c045 | |
parent | Conduit well-known (diff) | |
download | Rory-Open-Architecture-29c9eeeb228dbe62160d176d9dc72521ec225332.tar.xz |
Add side laptop
-rw-r--r-- | flake.lock | 230 | ||||
-rwxr-xr-x | flake.nix | 23 | ||||
-rw-r--r-- | host/RoryNix/configuration.nix | 172 | ||||
-rw-r--r-- | host/RoryNix/patches/haskell/basement/IntWord64.patch | 105 |
4 files changed, 512 insertions, 18 deletions
diff --git a/flake.lock b/flake.lock index ad6828e..84596c4 100644 --- a/flake.lock +++ b/flake.lock @@ -19,16 +19,122 @@ "type": "gitlab" } }, + "conduit": { + "inputs": { + "crane": "crane", + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1691746062, + "narHash": "sha256-FVVnNxCS2DHdo8mvRVvWZx1n2IWbdRZg+/QScTARaIY=", + "owner": "famedly", + "repo": "conduit", + "rev": "6dfb262ddff306b6712ac568aa4d84e9026f9bc9", + "type": "gitlab" + }, + "original": { + "owner": "famedly", + "repo": "conduit", + "type": "gitlab" + } + }, + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": [ + "conduit", + "flake-utils" + ], + "nixpkgs": [ + "conduit", + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1688772518, + "narHash": "sha256-ol7gZxwvgLnxNSZwFTDJJ49xVY5teaSvF7lzlo3YQfM=", + "owner": "ipetkov", + "repo": "crane", + "rev": "8b08e96c9af8c6e3a2b69af5a7fa168750fcf88e", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "conduit", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1689488573, + "narHash": "sha256-diVASflKCCryTYv0djvMnP2444mFsIG0ge5pa7ahauQ=", + "owner": "nix-community", + "repo": "fenix", + "rev": "39096fe3f379036ff4a5fa198950b8e79defe939", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1691998815, - "narHash": "sha256-HuFgb+W1Dvd0mjjudpTf0hVg/YKKiMRpX14t7dJeTm8=", + "lastModified": 1692720545, + "narHash": "sha256-DQDremUH7lRxiZEIVh6C6kQusuPe1vUKtiVl29nmP0E=", "owner": "nix-community", "repo": "home-manager", - "rev": "da6874e8bb82204323b94154585a1471c739f73e", + "rev": "8eb8c212e50e2fd95af5849585a2eb819add0a1e", "type": "github" }, "original": { @@ -54,13 +160,45 @@ "type": "github" } }, + "nixpkgs-RoryNix": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOs", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOs", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-rory": { + "locked": { + "lastModified": 1692044232, + "narHash": "sha256-KR+4xZq3+jU4q2gi6P86/7JlScSVzjZYD/FeYELQN84=", + "owner": "TheArcaneBrony", + "repo": "nixpkgs", + "rev": "9a20648eb212d7c8d581ec7722ec41de5215e418", + "type": "github" + }, + "original": { + "owner": "TheArcaneBrony", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1690881714, - "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "lastModified": 1692447944, + "narHash": "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "rev": "d680ded26da5cf104dd2735a51e88d2d8f487b4d", "type": "github" }, "original": { @@ -72,21 +210,87 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 0, - "narHash": "sha256-yHBvhXaqrOZGBYAv83CeTYIgUnMFMN1W58zSnhVf+ME=", - "path": "/Rory-Open-Architecture/nixpkgs", - "type": "path" + "lastModified": 1692638711, + "narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15", + "type": "github" }, "original": { - "path": "/Rory-Open-Architecture/nixpkgs", - "type": "path" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { "inputs": { "botcore-v4": "botcore-v4", + "conduit": "conduit", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "nixpkgs-RoryNix": "nixpkgs-RoryNix", + "nixpkgs-rory": "nixpkgs-rory" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1689441253, + "narHash": "sha256-4MSDZaFI4DOfsLIZYPMBl0snzWhX1/OqR/QHir382CY=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "996e054f1eb1dbfc8455ecabff0f6ff22ba7f7c8", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "conduit", + "crane", + "flake-utils" + ], + "nixpkgs": [ + "conduit", + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688351637, + "narHash": "sha256-CLTufJ29VxNOIZ8UTg0lepsn3X03AmopmaLTTeHDCL4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "f9b92316727af9e6c7fee4a761242f7f46880329", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index c797050..b8ef119 100755 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,15 @@ inputs = { nixpkgs = { - #url = "github:NixOS/nixpkgs/nixos-unstable"; - url="path:/Rory-Open-Architecture/nixpkgs"; + url = "github:NixOS/nixpkgs/nixos-unstable"; + #url="path:/Rory-Open-Architecture/nixpkgs"; + }; + nixpkgs-rory = { + #url = "path:/Rory-Open-Architecture/nixpkgs"; + url = "github:TheArcaneBrony/nixpkgs/master"; + }; + nixpkgs-RoryNix = { + url = "github:NixOs/nixpkgs/nixos-22.11"; }; botcore-v4 = { url = "gitlab:BotCore-Devs/BotCore-v4/staging"; @@ -20,12 +27,11 @@ # will probably also require you to always build from source. inputs.nixpkgs.follows = "nixpkgs"; }; - }; - outputs = { self, nixpkgs, home-manager, botcore-v4, conduit }: { + outputs = { self, nixpkgs, nixpkgs-RoryNix, nixpkgs-rory, home-manager, botcore-v4, conduit }: { nixosConfigurations = { - Rory-nginx = nixpkgs.lib.nixosSystem { + Rory-nginx = nixpkgs-rory.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./host/Rory-nginx/configuration.nix @@ -49,6 +55,13 @@ inherit home-manager; }; }; + RoryNix = nixpkgs-RoryNix.lib.nixosSystem { + system = "i686-linux"; + modules = [ + ./host/RoryNix/configuration.nix + ./hardware-configuration.nix + ]; + }; }; }; } diff --git a/host/RoryNix/configuration.nix b/host/RoryNix/configuration.nix new file mode 100644 index 0000000..4db2d44 --- /dev/null +++ b/host/RoryNix/configuration.nix @@ -0,0 +1,172 @@ +{ config, pkgs, ... }: + +{ + imports = + [ +# ./hardware-configuration.nix + ../../modules/packages/vim.nix + ]; + + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + version = 2; + device = "/dev/sda"; # nodev for EFI only + + # EFI + efiSupport = false; + efiInstallAsRemovable = false; + }; + }; + #readOnlyNixStore = false; + }; + + networking = { + hostName = "RoryNix"; + networkmanager.enable = true; + wireless.enable = false; + + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; + }; + + time.timeZone = "Europe/Brussels"; + i18n.defaultLocale = "en_US.UTF-8"; + + services = { + xserver = { + enable = true; + videoDrivers = [ "intel" ]; + desktopManager.gnome.enable = true; + libinput.enable = true; + layout = "us"; + modules = [ pkgs.xorg.xf86videointel ]; + }; + gnome = { + + core-developer-tools.enable = false; + core-utilities.enable = false; + tracker-miners.enable = false; + tracker.enable = false; + }; + + printing.enable = false; + openssh = { + enable = true; + extraConfig = '' + MaxAuthTries 32 + ''; + #X11Forwarding = true; + }; + }; + security.sudo.wheelNeedsPassword = false; + nixpkgs.config.allowUnfree = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + sound.enable = true; + hardware.pulseaudio.enable = true; + + users.users = { + Rory = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + packages = with pkgs; [ + #gimp-with-plugins + + #xterm + gnomeExtensions.vitals + gnomeExtensions.runcat + ]; + initialPassword = "password"; + }; + }; + + environment.systemPackages = with pkgs; [ + wget + neofetch + lnav + pciutils + zsh + gnome-console + feh + git + #lsd + steam + #nerdfonts + #element-web + sshfs + cinnamon.nemo + firefox-bin + #chromiumDev + htop + udisks + gparted + kitty.terminfo + glxinfo + #epiphany + # Various extensions... + # - Gnome + #gnomeExtensions.vitals + #gnomeExtensions.runcat + # - Dont work on gnome 43: + #gnomeExtensions.undecorate + #gnomeExtensions.inactivity + #gnomeExtensions.left-clock + # - Vim + vimPlugins.vim-nix + ]; + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + ]; + nixpkgs.overlays = [ + (self: super: { + python3 = super.python3.override { + packageOverrides = python-self: python-super: { + markdown-it-py = python-super.markdown-it-py.overrideAttrs (oldAttrs: { + doInstallCheck = false; + }); + }; + }; + haskellPackages = super.haskellPackages.override { + overrides = haskellPackages-self: haskellPackages-super: { + basement = haskellPackages-super.basement.overrideAttrs (oldAttrs: { + patches = [ + ./patches/haskell/basement/IntWord64.patch + ]; + }); + }; + }; + } + ) + ]; + security.polkit.enable = true; + + nix = { + distributedBuilds = true; + + buildMachines = [ + #"self" = { + # + #}; + { + systems = [ "x86_64-linux" "i686-linux" ]; + hostName = "192.168.0.3"; + sshUser = "Rory"; + sshKey = "/home/Rory/.ssh/id_ed25519"; + maxJobs = 12; + } + ]; + registry.nixpkgs.flake = pkgs; + nixPath = "nixpkgs=flake:nixpkgs"; + }; + + system.stateVersion = "22.11"; # DO NOT EDIT! + +} + diff --git a/host/RoryNix/patches/haskell/basement/IntWord64.patch b/host/RoryNix/patches/haskell/basement/IntWord64.patch new file mode 100644 index 0000000..0d1cdf7 --- /dev/null +++ b/host/RoryNix/patches/haskell/basement/IntWord64.patch @@ -0,0 +1,105 @@ +diff -up basement-0.0.15/Basement/Bits.hs~ basement-0.0.15/Basement/Bits.hs +--- basement-0.0.15/Basement/Bits.hs~ 2022-02-28 12:00:48.000000000 +0800 ++++ basement-0.0.15/Basement/Bits.hs 2023-02-16 18:50:32.947378064 +0800 +@@ -54,7 +54,7 @@ import GHC.Int + import Basement.Compat.Primitive + + #if WORD_SIZE_IN_BITS < 64 +-import GHC.IntWord64 ++import GHC.Exts + #endif + + -- | operation over finite bits +diff -up basement-0.0.15/Basement/Numerical/Additive.hs~ basement-0.0.15/Basement/Numerical/Additive.hs +--- basement-0.0.15/Basement/Numerical/Additive.hs~ 2022-02-28 12:00:48.000000000 +0800 ++++ basement-0.0.15/Basement/Numerical/Additive.hs 2023-02-16 18:52:14.547975419 +0800 +@@ -29,7 +29,7 @@ import qualified Basement.Types.Word128 + import qualified Basement.Types.Word256 as Word256 + + #if WORD_SIZE_IN_BITS < 64 +-import GHC.IntWord64 ++import GHC.Exts + #endif + + -- | Represent class of things that can be added together, +diff -up basement-0.0.15/Basement/Numerical/Conversion.hs~ basement-0.0.15/Basement/Numerical/Conversion.hs +--- basement-0.0.15/Basement/Numerical/Conversion.hs~ 2022-02-28 12:00:48.000000000 +0800 ++++ basement-0.0.15/Basement/Numerical/Conversion.hs 2023-02-16 18:28:38.844400110 +0800 +@@ -25,7 +25,7 @@ import GHC.Word + import Basement.Compat.Primitive + + #if WORD_SIZE_IN_BITS < 64 +-import GHC.IntWord64 ++import GHC.Exts + #endif + + intToInt64 :: Int -> Int64 +@@ -114,7 +114,7 @@ + #endif + #else + word64ToWord32s :: Word64 -> Word32x2 +-word64ToWord32s (W64# w64) = Word32x2 (W32# (word64ToWord# (uncheckedShiftRL64# w64 32#))) (W32# (word64ToWord# w64)) ++word64ToWord32s (W64# w64) = Word32x2 (W32# (wordToWord32# (word64ToWord# (uncheckedShiftRL64# w64 32#)))) (W32# (wordToWord32# (word64ToWord# w64))) + #endif + + wordToChar :: Word -> Char +diff -up basement-0.0.15/Basement/PrimType.hs~ basement-0.0.15/Basement/PrimType.hs +--- basement-0.0.15/Basement/PrimType.hs~ 2022-03-03 10:51:42.000000000 +0800 ++++ basement-0.0.15/Basement/PrimType.hs 2023-02-16 18:52:13.884971521 +0800 +@@ -54,7 +54,7 @@ import Basement.Nat + import qualified Prelude (quot) + + #if WORD_SIZE_IN_BITS < 64 +-import GHC.IntWord64 ++import GHC.Exts + #endif + + #ifdef FOUNDATION_BOUNDS_CHECK +diff -up basement-0.0.15/Basement/Types/OffsetSize.hs~ basement-0.0.15/Basement/Types/OffsetSize.hs +--- basement-0.0.15/Basement/Types/OffsetSize.hs~ 2019-09-02 11:58:08.000000000 +0800 ++++ basement-0.0.15/Basement/Types/OffsetSize.hs 2023-02-16 18:49:45.703100306 +0800 +@@ -69,7 +69,7 @@ import Data.List (foldl') + import qualified Prelude + + #if WORD_SIZE_IN_BITS < 64 +-import GHC.IntWord64 ++import GHC.Exts + #endif + + -- | File size in bytes +@@ -225,7 +225,7 @@ + + csizeOfSize :: CountOf Word8 -> CSize + #if WORD_SIZE_IN_BITS < 64 +-csizeOfSize (CountOf (I# sz)) = CSize (W32# (int2Word# sz)) ++csizeOfSize (CountOf (I# sz)) = CSize (W32# (wordToWord32# (int2Word# sz))) + #else + #if __GLASGOW_HASKELL__ >= 904 + csizeOfSize (CountOf (I# sz)) = CSize (W64# (wordToWord64# (int2Word# sz))) +@@ -238,7 +238,7 @@ + + csizeOfOffset :: Offset8 -> CSize + #if WORD_SIZE_IN_BITS < 64 +-csizeOfOffset (Offset (I# sz)) = CSize (W32# (int2Word# sz)) ++csizeOfOffset (Offset (I# sz)) = CSize (W32# (wordToWord32# (int2Word# sz))) + #else + #if __GLASGOW_HASKELL__ >= 904 + csizeOfOffset (Offset (I# sz)) = CSize (W64# (wordToWord64# (int2Word# sz))) +@@ -250,7 +250,7 @@ + sizeOfCSSize :: CSsize -> CountOf Word8 + sizeOfCSSize (CSsize (-1)) = error "invalid size: CSSize is -1" + #if WORD_SIZE_IN_BITS < 64 +-sizeOfCSSize (CSsize (I32# sz)) = CountOf (I# sz) ++sizeOfCSSize (CSsize (I32# sz)) = CountOf (I# (int32ToInt# sz)) + #else + #if __GLASGOW_HASKELL__ >= 904 + sizeOfCSSize (CSsize (I64# sz)) = CountOf (I# (int64ToInt# sz)) +@@ -261,7 +261,7 @@ + + sizeOfCSize :: CSize -> CountOf Word8 + #if WORD_SIZE_IN_BITS < 64 +-sizeOfCSize (CSize (W32# sz)) = CountOf (I# (word2Int# sz)) ++sizeOfCSize (CSize (W32# sz)) = CountOf (I# (word2Int# (word32ToWord# sz))) + #else + #if __GLASGOW_HASKELL__ >= 904 + sizeOfCSize (CSize (W64# sz)) = CountOf (I# (word2Int# (word64ToWord# sz))) |