From 3d2076dabb52db078c51bdd3914d9cff8c4ac1ea Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 12 Jan 2022 10:45:06 +0800 Subject: [PATCH] Add nix-alien for NixOS-related configurations --- flake.lock | 128 ++++++++++++++++++++++++++++- flake.nix | 13 ++- modules/nixos/profiles/desktop.nix | 10 ++- 3 files changed, 146 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 9a8eb165..10c8c134 100644 --- a/flake.lock +++ b/flake.lock @@ -97,6 +97,36 @@ } }, "flake-utils_3": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { "locked": { "lastModified": 1637014545, "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", @@ -172,6 +202,49 @@ "type": "github" } }, + "nix-alien": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs" + ], + "poetry2nix": "poetry2nix" + }, + "locked": { + "lastModified": 1639575084, + "narHash": "sha256-m5OFkwadjdyBOUZakhXiFH5HVqwbg2B5j/7GryhzMDU=", + "owner": "thiagokokada", + "repo": "nix-alien", + "rev": "11a6d4aa3096e2982e3204bbf89ca42205617c5c", + "type": "github" + }, + "original": { + "owner": "thiagokokada", + "repo": "nix-alien", + "type": "github" + } + }, + "nix-ld": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1637574694, + "narHash": "sha256-UHYvqGnsU4h5/Kt3gbiRbaMcN7hJ8u7ey8t4qO8maUI=", + "owner": "Mic92", + "repo": "nix-ld", + "rev": "6faa38511602d9c1c5ae44eaa0fc531e4b657576", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-ld", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1640871638, @@ -205,6 +278,21 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1641910925, + "narHash": "sha256-XBtRhGGBpuQxGo1aQPZpUmX+pfhAKC65XZbFOVtGILc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dea335ea03b6f9cb2bb156bd8801fa0a9d619f16", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1641016545, "narHash": "sha256-JMNwvnBzG0RjGG3eH27Y5/GlJ9ryeCdGJfqGbqxnmZY=", @@ -235,6 +323,25 @@ "type": "github" } }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1639522248, + "narHash": "sha256-LNIVOj0SvJ0XCqaD3EW712yPUQkD5MWjC0vmJCV1oxc=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "c8cadfffd9589b393f010f40aede44434302e845", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -243,14 +350,16 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "neovim-nightly-overlay": "neovim-nightly-overlay", - "nixpkgs": "nixpkgs_3", + "nix-alien": "nix-alien", + "nix-ld": "nix-ld", + "nixpkgs": "nixpkgs_4", "nur": "nur", "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixpkgs" ] @@ -268,6 +377,21 @@ "repo": "rust-overlay", "type": "github" } + }, + "utils": { + "locked": { + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8b93a28d..29e15045 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,12 @@ nur.url = "github:nix-community/NUR"; nur.inputs.nixpkgs.follows = "nixpkgs"; + # Running unpatched binaries on NixOS! :O + nix-ld.url = "github:Mic92/nix-ld"; + nix-ld.inputs.nixpkgs.follows = "nixpkgs"; + nix-alien.url = "github:thiagokokada/nix-alien"; + nix-alien.inputs.nixpkgs.follows = "nixpkgs"; + # Managing your secrets. agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "nixpkgs"; @@ -92,8 +98,11 @@ # Stallman-senpai will be disappointed. nixpkgs.config.allowUnfree = true; - # Extend nixpkgs with our own package set. - nixpkgs.overlays = overlays; + # Extend nixpkgs with our overlays except for the NixOS-focused modules + # here. + nixpkgs.overlays = overlays ++ [ + inputs.nix-alien.overlay + ]; # Please clean your temporary crap. boot.cleanTmpDir = true; diff --git a/modules/nixos/profiles/desktop.nix b/modules/nixos/profiles/desktop.nix index 04d330e1..63067d1a 100644 --- a/modules/nixos/profiles/desktop.nix +++ b/modules/nixos/profiles/desktop.nix @@ -1,7 +1,7 @@ # This is where extra desktop goodies can be found. # As a note, this is not where you set the aesthetics of your graphical sessions. # That can be found in the `themes` module. -{ config, options, lib, pkgs, ... }: +{ inputs, config, options, lib, pkgs, ... }: let cfg = config.profiles.desktop; in { @@ -24,6 +24,7 @@ in { }; }; + imports = [ inputs.nix-ld.nixosModules.nix-ld ]; config = lib.mkIf cfg.enable (lib.mkMerge [ ({ # Enable Flatpak for additional options for installing desktop applications. @@ -36,6 +37,13 @@ in { # Enable font-related options for more smoother and consistent experience. fonts.enableDefaultFonts = true; + + # Run unpatched binaries with these! + environment.systemPackages = with pkgs; [ + nix-alien + nix-index + nix-index-update + ]; }) (lib.mkIf cfg.audio.enable {