Migrate to flakes

This commit is contained in:
coolneng 2021-08-08 19:56:16 +01:00
parent 71d8daf782
commit 88a7394651
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
7 changed files with 189 additions and 30 deletions

View File

@ -36,7 +36,7 @@
timeout = 3;
};
# Run Nix garbage collector, while avoiding compiling
# Run Nix garbage collector and enable flakes
nix = {
autoOptimiseStore = true;
gc = {
@ -48,7 +48,9 @@
keep-outputs = true
keep-derivations = true
gc-keep-outputs = true
experimental-features = nix-command flakes
'';
package = pkgs.nixUnstable;
};
# Clean tmp directory on shutdown
@ -100,7 +102,6 @@
# Import other configuration modules
imports = [
<nixpkgs/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix>
./modules/hardware-configuration.nix
./modules/software.nix
./modules/networking.nix

145
flake.lock Normal file
View File

@ -0,0 +1,145 @@
{
"nodes": {
"agenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1627822587,
"narHash": "sha256-AAFgsVe/ahLh1Ij2o98x6IMxz3Z+Tr97bFwa4nthB1w=",
"owner": "ryantm",
"repo": "agenix",
"rev": "e6752e7b8592502df42066f156165471e62d902d",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"emacs-overlay": {
"locked": {
"lastModified": 1628443422,
"narHash": "sha256-Sq+eaw+UCYr4C5jzbjMk1bzrmLFxA5rN1pgYAGvT/AM=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "d962fd773274e8303bc96ca64fb3569aec5ac764",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1605267184,
"narHash": "sha256-0FSNlq6nN0/W88fg5kTkgRhAOQ8pI+uSZqBG9w49pMM=",
"owner": "nmattia",
"repo": "naersk",
"rev": "ce273fa593dcc94a629d0d869f07d96d2b337e37",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1628287055,
"narHash": "sha256-YwxtAt25pZofJT/e4sxw9cFBaFok+zgIy04HFV0rDd0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0dde103318090f77ac95ef7fc26fe0cdd00fa0b3",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1605988311,
"narHash": "sha256-PA+kgq46NApOAJlmBNJHs5DwsIrY+jodM0e4g7VtXyY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2247d824fe07f16325596acc7faa286502faffd1",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1605988311,
"narHash": "sha256-PA+kgq46NApOAJlmBNJHs5DwsIrY+jodM0e4g7VtXyY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2247d824fe07f16325596acc7faa286502faffd1",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"rnix-lsp": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_3",
"utils": "utils"
},
"locked": {
"lastModified": 1626644818,
"narHash": "sha256-w0hpyFXxltmOpbBKNQ2tfKRWELQzStc/ho1EcNyYaWc=",
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "1fdd7cf9bf56b8ad2dddcfd27354dae8aef2b453",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "rnix-lsp",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"emacs-overlay": "emacs-overlay",
"nixpkgs": "nixpkgs",
"rnix-lsp": "rnix-lsp"
}
},
"utils": {
"locked": {
"lastModified": 1605370193,
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5021eac20303a61fafe17224c087f5519baed54d",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View File

@ -0,0 +1,31 @@
{
description = "System configuration for panacea";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
emacs-overlay.url = "github:nix-community/emacs-overlay";
rnix-lsp.url = "github:nix-community/rnix-lsp";
};
outputs = { self, nixpkgs, agenix, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import pkgs {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in {
nixosConfigurations.panacea = lib.nixosSystem {
inherit system;
modules = [ (import ./configuration.nix) agenix.nixosModules.age ];
specialArgs = { inherit inputs; };
};
};
}

View File

@ -1,17 +1,6 @@
{ config, lib, pkgs, ... }:
let
soundcloud_token =
builtins.readFile /home/coolneng/.config/mopidy/soundcloud-auth;
fixed-mopidy-youtube = pkgs.mopidy-youtube.overrideAttrs (old: rec {
patchPhase = ''
sed s/bs4/beautifulsoup4/ -i setup.cfg
sed s/"PREF=hl=en;"/"PREF=hl=en; CONSENT=YES+20210329;"/ -i mopidy_youtube/backend.py
'';
});
in {
{
# Configure pipewire as sound server
services.pipewire = {
enable = true;
@ -45,7 +34,7 @@ in {
extensionPackages = with pkgs; [
mopidy-mpd
mopidy-soundcloud
fixed-mopidy-youtube
mopidy-youtube
mopidy-somafm
mopidy-local
];
@ -75,7 +64,7 @@ in {
[soundcloud]
enabled = true
auth_token = ${soundcloud_token}
auth_token = PLACEHOLDER
explore_songs = 100
[m3u]

View File

@ -1,8 +1,6 @@
{ config, lib, pkgs, ... }:
let tmux_config = builtins.readFile /home/coolneng/.tmux.conf;
in {
{
# Display manager
services.xserver.enable = true;
services.xserver.displayManager = {
@ -86,7 +84,6 @@ in {
shortcut = "x";
terminal = "screen-256";
baseIndex = 1;
extraConfig = tmux_config;
};
# Automount external storage

View File

@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, inputs, ... }:
with pkgs;
let
emacs-vterm = ((emacsPackagesNgGen emacsPgtkGcc).emacsWithPackages
(epkgs: with epkgs; [ vterm ]));
(epkgs: [ epkgs.vterm ]));
in {
environment.systemPackages = [
@ -16,6 +16,7 @@ in {
pass-wayland
passff-host
gitAndTools.pass-git-helper
inputs.agenix.defaultPackage.x86_64-linux
# Browsers
firefox
ungoogled-chromium
@ -83,7 +84,7 @@ in {
shfmt
## Nix
nixfmt
niv
rnix-lsp
## Python
nodePackages.pyright
black

View File

@ -1,8 +1,3 @@
{
nixpkgs.overlays = [
(import (builtins.fetchTarball {
url =
"https://github.com/nix-community/emacs-overlay/archive/master.tar.gz";
}))
];
{ config, lib, pkgs, inputs, ... }: {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
}