point $NIX_PATH to ~/.nix-defexpr/channels

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I would like to point $NIX_PATH to ~/.nix-defexpr/channels instead of ~/.nix-defexpr/channels_root as currently. I don't want to have to type that every time I run nix-env. What's the right way of doing that?







share|improve this question
















  • 1




    Might be helpful: unix.stackexchange.com/questions/377599/…
    – gmarmstrong
    Apr 4 at 19:28














up vote
0
down vote

favorite












I would like to point $NIX_PATH to ~/.nix-defexpr/channels instead of ~/.nix-defexpr/channels_root as currently. I don't want to have to type that every time I run nix-env. What's the right way of doing that?







share|improve this question
















  • 1




    Might be helpful: unix.stackexchange.com/questions/377599/…
    – gmarmstrong
    Apr 4 at 19:28












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I would like to point $NIX_PATH to ~/.nix-defexpr/channels instead of ~/.nix-defexpr/channels_root as currently. I don't want to have to type that every time I run nix-env. What's the right way of doing that?







share|improve this question












I would like to point $NIX_PATH to ~/.nix-defexpr/channels instead of ~/.nix-defexpr/channels_root as currently. I don't want to have to type that every time I run nix-env. What's the right way of doing that?









share|improve this question











share|improve this question




share|improve this question










asked Feb 18 at 1:39









dmvianna

322311




322311







  • 1




    Might be helpful: unix.stackexchange.com/questions/377599/…
    – gmarmstrong
    Apr 4 at 19:28












  • 1




    Might be helpful: unix.stackexchange.com/questions/377599/…
    – gmarmstrong
    Apr 4 at 19:28







1




1




Might be helpful: unix.stackexchange.com/questions/377599/…
– gmarmstrong
Apr 4 at 19:28




Might be helpful: unix.stackexchange.com/questions/377599/…
– gmarmstrong
Apr 4 at 19:28










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










I would simply define the variable the way you want it in your ~/.profile.






share|improve this answer
















  • 1




    And give up statelessness?
    – dmvianna
    Feb 18 at 21:02










  • What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
    – Vladimír Čunát
    Feb 19 at 18:14







  • 1




    Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
    – dmvianna
    Feb 20 at 10:50






  • 1




    See e.g. nix-cookbook.readthedocs.io/en/latest/…
    – Vladimír Čunát
    Feb 20 at 23:31

















up vote
0
down vote













I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do



$ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels


This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root is read instead. Which is what I'm trying to avoid here.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424889%2fpoint-nix-path-to-nix-defexpr-channels%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    I would simply define the variable the way you want it in your ~/.profile.






    share|improve this answer
















    • 1




      And give up statelessness?
      – dmvianna
      Feb 18 at 21:02










    • What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
      – Vladimír Čunát
      Feb 19 at 18:14







    • 1




      Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
      – dmvianna
      Feb 20 at 10:50






    • 1




      See e.g. nix-cookbook.readthedocs.io/en/latest/…
      – Vladimír Čunát
      Feb 20 at 23:31














    up vote
    1
    down vote



    accepted










    I would simply define the variable the way you want it in your ~/.profile.






    share|improve this answer
















    • 1




      And give up statelessness?
      – dmvianna
      Feb 18 at 21:02










    • What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
      – Vladimír Čunát
      Feb 19 at 18:14







    • 1




      Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
      – dmvianna
      Feb 20 at 10:50






    • 1




      See e.g. nix-cookbook.readthedocs.io/en/latest/…
      – Vladimír Čunát
      Feb 20 at 23:31












    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    I would simply define the variable the way you want it in your ~/.profile.






    share|improve this answer












    I would simply define the variable the way you want it in your ~/.profile.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 18 at 19:27









    Vladimír Čunát

    62135




    62135







    • 1




      And give up statelessness?
      – dmvianna
      Feb 18 at 21:02










    • What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
      – Vladimír Čunát
      Feb 19 at 18:14







    • 1




      Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
      – dmvianna
      Feb 20 at 10:50






    • 1




      See e.g. nix-cookbook.readthedocs.io/en/latest/…
      – Vladimír Čunát
      Feb 20 at 23:31












    • 1




      And give up statelessness?
      – dmvianna
      Feb 18 at 21:02










    • What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
      – Vladimír Čunát
      Feb 19 at 18:14







    • 1




      Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
      – dmvianna
      Feb 20 at 10:50






    • 1




      See e.g. nix-cookbook.readthedocs.io/en/latest/…
      – Vladimír Čunát
      Feb 20 at 23:31







    1




    1




    And give up statelessness?
    – dmvianna
    Feb 18 at 21:02




    And give up statelessness?
    – dmvianna
    Feb 18 at 21:02












    What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
    – Vladimír Čunát
    Feb 19 at 18:14





    What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash.
    – Vladimír Čunát
    Feb 19 at 18:14





    1




    1




    Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
    – dmvianna
    Feb 20 at 10:50




    Yes, but we try to keep the state in /etc/nixos/configuration.nix and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues.
    – dmvianna
    Feb 20 at 10:50




    1




    1




    See e.g. nix-cookbook.readthedocs.io/en/latest/…
    – Vladimír Čunát
    Feb 20 at 23:31




    See e.g. nix-cookbook.readthedocs.io/en/latest/…
    – Vladimír Čunát
    Feb 20 at 23:31












    up vote
    0
    down vote













    I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do



    $ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels


    This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root is read instead. Which is what I'm trying to avoid here.






    share|improve this answer
























      up vote
      0
      down vote













      I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do



      $ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels


      This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root is read instead. Which is what I'm trying to avoid here.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do



        $ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels


        This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root is read instead. Which is what I'm trying to avoid here.






        share|improve this answer












        I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do



        $ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels


        This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root is read instead. Which is what I'm trying to avoid here.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 18 at 10:33









        dmvianna

        322311




        322311






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424889%2fpoint-nix-path-to-nix-defexpr-channels%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?