Dear all, I defined a flake for a program I want to use here, how could I include this in a nixos configuration also with flakes? I include the repo as input but have no clue how to get the actual package into my config. It looks like this at the moment:
description = "System configuration for all my computers";
inputs = {
nixos.url = "github:NixOS/nixpkgs/nixos-21.11";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
emacs-overlay.url = "github:nix-community/emacs-overlay/master";
doom-emacs = {
url = "github:hlissner/doom-emacs/develop";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixos";
};
nix-doom-emacs = {
url = "github:nix-community/nix-doom-emacs/master";
inputs = {
doom-emacs.follows = "doom-emacs";
nixpkgs.follows = "nixos";
emacs-overlay.follows = "emacs-overlay";
flake-utils.follows = "flake-utils";
};
};
home-manager = {
url = "github:nix-community/home-manager/release-21.11";
inputs = { nixpkgs.follows = "nixos"; };
};
agenix = {
url = "github:ryantm/agenix/main";
inputs.nixpkgs.follows = "nixos";
};
mage = {
url = "github:timhae/mage/release";
inputs.nixpkgs.follows = "nixos";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixos, nixos-unstable, emacs-overlay, nix-doom-emacs
, doom-emacs, home-manager, agenix, mage, ... }:
let
system = "x86_64-linux";
user = "tim";
pkgs = mkPkgs (import nixos) [
(_: super: {
steam = super.steam.override { extraPkgs = pkgs: [ pkgs.libpng ]; };
})
];
pkgs-unstable = mkPkgs (import nixos-unstable) [ ];
mkPkgs = pkgs: overlays:
pkgs {
inherit system;
overlays = [ emacs-overlay.overlay ] ++ overlays;
config.allowUnfree = true;
};
cfg = machine:
nixos.lib.nixosSystem {
inherit pkgs system;
specialArgs = { inherit pkgs pkgs-unstable agenix mage; };
modules = [
(./. + "/${machine}.nix")
nixos.nixosModules.notDetected
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users."${user}" = { pkgs, ... }: {
imports =
[ nix-doom-emacs.hmModule (./. + "/${machine}Home.nix") ];
};
};
}
agenix.nixosModules.age
];
};
in {
nixosConfigurations.nixosLaptop = cfg "laptop";
nixosConfigurations.nixosDesktop = cfg "desktop";
nixosConfigurations.nixosServer = cfg "server";
};
}
and in laptop.nix I have:
{ config, lib, pkgs, mage, ... }: {
imports = [ ./common/common.nix ./common/gaming.nix ./common/udev.nix ];
boot = {
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
initrd = {
availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
kernelModules = [ "dm-snapshot" ];
luks.devices.root = {
device = "/dev/nvme0n1p2";
preLVM = true;
};
};
};
environment.systemPackages = with pkgs; [
acpi # for info script
iw # wifi signal strength
xorg.xbacklight # enable backlight function keys
mage.defaultPackage.x86_64-linux # how????
];
fileSystems."/" = {
device = "/dev/disk/by-uuid/7649fbf8-3ab1-4991-a283-bcb872a5e0c3";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/AF89-3C32";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/b3749b7b-f9c4-4af9-a8fe-ef1b93b37159"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
networking.hostName = "nixosLaptop"; # Define your hostname
powerManagement.powertop.enable = true;
services.upower.enable = true;
services.xserver = {
dpi = 144;
libinput = {
touchpad = {
accelSpeed = "1";
naturalScrolling = true;
};
};
};
}
What do I need to put in my environment.systemPackages
to get the progam I defined in the flake? can someone please point me to documentation covering this topic? Or maybe give me a hint what I am doing wrong? thanks a lot!!