From 11b2d9671adb775f373d4b3ec5f27fdf7ea957c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Mon, 1 Aug 2022 19:36:19 -0300 Subject: [PATCH] Add nixos config --- flake.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 28 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0dd7a7c --- /dev/null +++ b/flake.lock @@ -0,0 +1,81 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1659336065, + "narHash": "sha256-vjHzA2MRrw6seWzBGUA2dciObvf1Be4lA3SsAI5aufA=", + "owner": "nix-community", + "repo": "fenix", + "rev": "75a63f0868d8362aaa0ae2f9d5e77a65780fdd58", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1659219666, + "narHash": "sha256-pzYr5fokQPHv7CmUXioOhhzDy/XyWOIXP4LZvv/T7Mk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7b9be38c7250b22d829ab6effdee90d5e40c6e5c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1659290320, + "narHash": "sha256-OUezy1BkIoqpkTE5wOtsjJ/Gy48Ql8EL1/t6MZzRkWw=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "2b472f6684bb1958274995d12b2c50310d88cc52", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ae5c932 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "dmenu wrapper to sort inputs based on previous outputs"; + inputs = { + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + outputs = { self, fenix, flake-utils, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + rust_platform = pkgs.makeRustPlatform { + inherit (fenix.packages.${system}.minimal) cargo rustc; + }; + dhist_pkg = rust_platform.buildRustPackage { + pname = "dhist"; + version = "0.1"; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + }; + in { + packages.dhist = dhist_pkg; + packages.default = dhist_pkg; + }); +}